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

SetFieldValue Method


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

Syntax

BusComp.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 Method. 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 the Siebel Repository (not in the status line of the application or the list column header), 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.

To set a field to null, follow this example:

SetFieldValue "Name", ""

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 the Pick method to emulate the user picking the record.

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

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:

If Val(Me.GetFieldValue("Rep %")) < 75 Then
   Me.SetFieldValue "Rep %", "75"
   Me.WriteRecord
End If

The following is the equivalent example in Siebel eScript:

if (ToInteger(this.GetFieldValue("Rep %")) < 75)

{
this.SetFieldValue("Rep %", "75");
this.WriteRecord();
}

Related Topics

ActivateField Method
SetFormattedFieldValue Method
Pick Method
GetPicklistBusComp Method

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