ActivateField Method
The ActivateField method activates a business component field. It returns nothing. It uses the following syntax:
this.ActivateField(field_name);
bc.ActivateField("field_name");// calling from another JavaScript file
where:
field_name identifies the name of a business component field.
A field is inactive except in the following situations, by default:
The field is a system field, such as Id, Created, Created By, Updated, or Updated By.
The Force Active property of the field is TRUE.
The Link Specification property of the field is TRUE.
An active applet includes the field, and this applet references a business component that is active.
The field resides in an active list applet, and the Show In List property of the list column that displays this field in the applet is TRUE.
Note the following:
Siebel CRM calls the ActivateField method on the field, and then runs the ExecuteQuery method.
If Siebel CRM calls the ActivateField method after it calls the ExecuteQuery method, then the ActivateField method deletes the query context.
The ActivateField method causes Siebel CRM to include the field in the SQL statement that the ExecuteQuery method starts. If Siebel CRM activates a field, and if a statement in the GetFieldValue method or the SetFieldValue method references the file before Siebel CRM performs a statement from the ExecuteQuery method, then the activation has no effect.
Example
The following example uses the ActivateField method to activate the Login Name field that resides in the Contact business component:
var currRetValue={err:false}, retObj;
var model= SiebelApp.S_App.GetModel();
var boContact = model.GetBusObject("Contact");
var bcContact = boContact.GetBusComp("Contact");
bcContact.ClearToQuery();
currRetValue=bcContact.ActivateField("Login Name");
var sLoginName = "MYNAME";
bcContact.SetSearchSpec("Login Name", sLoginName);
retObj=currRetValue=bcContact.ExecuteQuery();
if (!retObj.err) {
model.ReleaseBO(boContact);
}