Siebel Object Interfaces Reference > Interfaces Reference > Business Component Methods >
GetFieldValue returns the value for the field specified in its argument for the current record of the business component. Use this method to access a field value.
String variable or literal containing the name of the field
A string containing the field value of the field identified in FieldName, an error message if the field is inactive, or an empty string if the field is empty.
NOTE: Date fields retrieved by GetFieldValue() are always returned using the format MM/DD/YYYY, no matter what your local date format is set to. Use GetFormattedFieldValue() to get the same date format you use in the client interface.
Only fields that were active at the time of the BusComp query contain values. For more information, read ActivateField Method. If this method is used on fields that are not active, an error message is returned. If this method is used on fields that are empty, an empty string is returned.
CAUTION: If a value from a business component that is a child of the current business component is desired, the Link Specification property for that field must be set to TRUE in Siebel Tools. Otherwise, the parent business component cannot access the value in the child business component. For more information, read Object Types Reference.
The FieldName must be enclosed in double quotes and must be spelled exactly as the field name appears in Siebel Tools, with the correct case; for example,
"Person who created the activity", as shown in the status bar, does not work; nor does the column head
NOTE: In Browser Script, GetFieldValue can be used only for the fields exposed in the applet and for the system Id field.
Browser Script, COM Data Control, COM Data Server, Java Data Bean, Mobile Web Client Automation Server, Server Script
The following example is in Siebel VB. It shows an implementation of the PreSetFieldValue event to illustrate the use of GetFieldValue:
Function BusComp_PreSetFieldValue (FieldName As String, FieldValue As String) As Integer
Dim bcOppty As BusComp
Dim boBusObj As BusObject
Dim srowid As String
srowid = GetFieldValue("Id")
Set boBusObj = TheApplication.GetBusObject("Opportunity")
Set bcOppty = boBusObj.GetBusComp("Opportunity")
.ActivateField "Sales Stage"
.SetSearchSpec "Id", srowid
Set bcOppty = Nothing
Set boBusObj = Nothing
The following is the equivalent example in Siebel eScript.
function BusComp_PreSetFieldValue (FieldName, FieldValue)
var boBusObj = TheApplication().GetBusObject("Opportunity");
var bcOppty = boBusObj.GetBusComp("Opportunity");
var srowid = GetFieldValue("Id");
bcOppty = null;
boBusObj = null;