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

ActivateField Method

ActivateField allows queries to retrieve data for the argument-specified field.





String variable or literal containing the name of the field to activate


Not applicable


FieldName must be enclosed in double quotes and must be spelled exactly as the field name appears in Siebel Tools, using the same case. You must activate fields using ActivateField prior to executing a query for the business component.

NOTE:  If you are writing an event handler on a business component, you must make sure that the field has already been activated by specifying the ForceActive user property on the control.

By default, fields are inactive except when:

  • They are displayed on the applet and the business component is the instance on which the applet is based.
  • They are System fields (which include Id, Created, Created By, Updated, and Updated By).
  • Their ForceActive property is set to TRUE.
  • The method ActivateField has been invoked with the FieldName.
  • They have the Link Specification property set to TRUE.

After a business component has been executed, if additional fields are activated, the business component must be requeried before field values can be accessed. Failure to requery the business component results in a value of 0 being returned. The ActivateField method destroys the context of a query when it is used after the ExecuteQuery method.

The ActivateField method forces the specified field to be included in the SQL statement that is initiated by an ExecuteQuery method that follows. ActivateField should always be followed by ExecuteQuery. If a field is activated and then referenced by a GetFieldValue or SetFieldValue statement prior to an ExecuteQuery statement, the activation has no effect. The activated field is not retrieved through a query, so it contains an empty value.

If a field is not activated prior to a WriteRecord, the data is written to the database, but corruption issues may arise when mobile users synchronize. An ActivateField call prior to an ExecuteQuery call, followed by a WriteRecord, makes sure that the field is written correctly to the transaction log so that changes made by mobile users are saved back to the server database correctly at synchronization time.

Used With

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


The following example is in Siebel VB. For an equivalent Siebel eScript example, read ClearToQuery Method.

Dim oEmpBusObj As BusObject
Dim oEmpBusComp As BusComp
Dim sLoginName As String

Set oEmpBusObj = TheApplication.ActiveBusObject
Set oEmpBusComp = oEmpBusObj.GetBusComp("Employee")
oEmpBusComp.ActivateField("Login Name")
oEmpBusComp.SetViewMode AllView
oEmpBusComp.SetSearchSpec "Login Name", sLoginName
Set oEmpBusComp = Nothing

See Also

DeactivateFields Method

Siebel Object Interfaces Reference