GetFieldValue Method for a Business Component

The GetFieldValue method returns one of the following items:

  • A string that contains the value of a field from the current record of a business component.

  • An empty string if the field is empty.

  • An error message if the field is inactive. To avoid this situation, activate the field before you use the GetFieldValue method. For more information, see ActivateField Method for a Business Component.

The GetFieldValue method uses the MM/DD/YYYY format when it returns a date field regardless of what format the local date uses. To return the date in the same format that the local date uses, you can use the GetFormattedFieldValue method. For more information, see GetFormattedFieldValue Method for a Business Component.

In Browser Script, you can use the GetFieldValue method only if the field is available in the applet and for system fields.

Format

BusComp.GetFieldValue(FieldName)

The arguments you can use in this format are the same as the arguments described in ActivateField Method for a Business Component.

Usage for the GetFieldValue Method

If you require a value from a business component that is a parent of the current business component, then you must make sure the Link Specification property for that field is set to TRUE in Siebel Tools. If it is not, then the child business component cannot access the value in the parent business component. For more information, see Siebel Object Types Reference.

Used With

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

Examples

The following example is in Siebel VB:

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")
   With bcOppty
      .SetViewMode SalesRepView
      .ActivateField "Sales Stage"
      .SetSearchSpec "Id", srowid
      .ExecuteQuery ForwardOnly
   End With

   Set bcOppty = Nothing
   Set boBusObj = Nothing

End Function

The following example is in Siebel eScript:

function BusComp_PreSetFieldValue (FieldName, FieldValue)

   var boBusObj = TheApplication().GetBusObject("Opportunity");
   var bcOppty = boBusObj.GetBusComp("Opportunity");
   var srowid = GetFieldValue("Id");

   with (bcOppty)
   {
      SetViewMode(SalesRepView);
      ActivateField("Sales Stage");
      SetSearchSpec("Id", srowid);
      ExecuteQuery(ForwardOnly);
   }

   bcOppty = null;
   boBusObj = null;
}