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

SetFieldValue


SetFieldValue assigns the new value to the named field for the current row of the business component.

Syntax

oBusComp.SetFieldValue FieldName, FieldValue

Argument
Description
FieldName
String containing the name of the field to assign the value to
FieldValue
String containing the value to assign

Returns

Not applicable

Usage

This method can be used only on fields that are active. For details, read ActivateField. For applications in Standard Interactivity mode, write the record immediately after using SetFieldValue by calling WriteRecord.

FieldName must be enclosed in double quotes, and must be spelled exactly as the field name appears in Siebel Tools (not in the status line of the application or the column head), with the correct case; for example,

SetFieldValue "Name", "Acme"

FieldValue must not have a length that exceeds the defined length of the field. For example, passing a 20 character string into a field that is defined as being 16 characters long results in the runtime error "Value too long for field 'xxxxx' (maximum size nnn)." A good practice is to check the length of the string against the length of the destination field before using SetFieldValue.

Do not use the SetFieldValue method on a field that has a pick list. Instead, use the following procedure:

  1. Use GetPicklistBusComp(...) to get a reference to the picklist business component for the Last Name field.
  2. Set the required SearchSpec on the pick list business component so that a single unique record is returned.
  3. Execute the query on the pick list business component.
  4. Call picklistbuscomp.Pick to emulate the user picking the record.

NOTE:  SetFieldValue cannot be used with calculated fields and cannot be used recursively.

Used With

Browser Script, Server Script, Mobile/Dedicated Web Client Automation Server, COM Data Control, COM Data Server, Java Data Bean, CORBA Object Manager

Example

Here is a Siebel VB example.

Dim CurrOppty as BusComp
Set CurrOppty = TheApplication.ActiveBusComp
If Val(CurrOppty.GetFieldValue("Rep %")) < 75 Then
   CurrOppty.SetFieldValue "Rep %", "75"
End If

Here is the same example in Siebel eScript.

var CurrOppty = TheApplication().ActiveBusComp()
if (ToInteger(CurrOppty.GetFieldValue("Rep %")) < 75)
   CurrOppty.SetFieldValue("Rep %", "75");

See Also

ActivateField
SetFormattedFieldValue
Pick
GetPicklistBusComp


 Siebel Object Interfaces Reference 
 Published: 18 June 2003