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

GetFieldValue Method


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.

Syntax

BusComp.GetFieldValue(FieldName)

Argument
Description

FieldName

String variable or literal containing the name of the field

Returns

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.

Usage

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 parent of the current business component is desired, the Link Specification property for that field must be set to TRUE in Siebel Tools. Otherwise, the child business component cannot access the value in the parent business component. For more information on the Link Specification property, see Siebel Object Types Reference.

The FieldName must be enclosed in double quotes and must be spelled exactly as the field name appears in Siebel Tools, for example:

GetFieldValue("ActivityCreatedByName")

The name "Person who created the activity", as shown in the status bar, does not work; nor does the column head "Created By".

NOTE:  In Browser Script, GetFieldValue can be used only for the fields exposed in the applet and for system fields.

Used With

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

Example

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

   Set bcOppty = Nothing
   Set boBusObj = Nothing

End Function

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");

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

   bcOppty = null;
   boBusObj = null;
}

Related Topics

ActivateField Method
GetFormattedFieldValue Method

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