Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >

GetFormattedFieldValue Method

GetFormattedFieldValue returns the field value in the current local format; it returns values in the same format as the Siebel UI.





String variable or literal containing the name of the field to obtain the value from


A string containing the value of the requested field, in the same format as displayed in the user interface, or an empty string ("") if the field is inactive or empty.


GetFormattedFieldValue is useful for code that is used in multiple countries with different formats for currency, date, and number. This method can be used only on fields that have been activated using ActivateField.

Some special behavior is associated with particular data types.

DTYPE_PHONE. When used on fields of DTYPE_PHONE, these methods return formatted phone numbers.

Example 1:

phone = bc.GetFieldValue("Main Phone Number")
TheApplication.Trace "The number is " & phone


The number is 8869629123

Example 2:

phone = bc.GetFormattedFieldValue("Main Phone Number")
TheApplication.Trace "The number is " & phone


The number is (886) 962-9123

DTYPE_DATE. When used on fields of DTYPE_DATE, these methods are the same as GetFieldValue and SetFieldValue, except that the result is in the format of the Regional Setting.

Table 34 shows the standard formats used by GetFieldValue and SetFieldValue to return data.

Table 34. Date and Time Formats
Type of Data






mm/dd/yyyy hh:nn:ss

If you attempt to use SetFieldValue and your Regional Setting format is different, you receive an error like this:

Error: The value '31-Dec-99' can not be converted to a date time value.

This error can be avoided by using the GetFormattedFieldValue and SetFormattedFieldValue methods.

Used With

Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script


The following Siebel VB example demonstrates how to use the GetFormattedFieldValue function and how to calculate the number of days between two dates.

Sub Button_Click
   Dim DateDiff as Integer
   Dim oBC as BusComp
   Set oBC= me.BusComp
   x = oBC.GetFormattedFieldValue("Start Date")
   y = oBC.GetFormattedFieldValue("Done")
   dx = DateValue(x)
   dy = DateValue(y)
   DateDiff = dy - dx
End Sub

Related Topics

ActivateField Method
GetFieldValue Method
SetFieldValue Method
SetFormattedFieldValue Method

Siebel Object Interfaces Reference Copyright © 2008, Oracle. All rights reserved.