Handling the Date Format in Siebel VB

If you use an object interface method that includes a date, then use caution regarding the date format. The GetFieldValue method returns the date in the following format:

dd/mm/yyyy

The CVDate function expects the regional setting. If you apply it, then Siebel CRM might return an error. The GetFormattedFieldValue method uses the regional settings of the operating system that is installed on the computer that runs the Siebel client. The regional setting might specify the year with two digits, and can cause an error with the year 2000 problem. For these reasons, use the following procedure for performing date arithmetic.

To handle the date format in Siebel VB

  1. To return the value of the date fields, use the GetFieldValue object interface method.

    For more information, see GetFieldValue Method for a Business Component.

  2. Use the DateSerial function convert the value of the date field to a date variable.

  3. Perform the required date arithmetic.

    For example, you can use the following Siebel VB code:

    Dim strDate as String, varDate as Variant
    strDate = oBC.GetFieldValue("Date Field")
    varDate =DateSerial(Val(Mid(strDate,7,4)),Val(Left(strDate,2)),_
       Val(Mid(strDate,4,2)))
    any date arithmetic