Searching or Sorting According to the Division
You can use the DivisionId function and DivisionName function in a search specification, sort specification, or calculated value. For example, assume Siebel CRM must display only the employees who reside in the same division as the person who is currently logged in. To configure this requirement, you can add the following DivisionId function to the Search Specification property of an applet:
"DivisionId() = [Division Id]"
These functions are not available in a script. To get the division ID or division name in a script, you must use the GetFieldValue business component method. For example, you can use the following code in a Siebel eScript script to get the division ID:
var oEmpl = TheApplication().GetBusObject("Employee");
var bcEmp = oEmpl.GetBusComp("Employee"); bcEmp.ActivateField("Division
Id"); bcEmp.ActivateField("Login Id"); bcEmp.SetSearchSpec("Login Id",
TheApplication().LoginId()); bcEmp.ExecuteQuery(ForwardOnly); bcEmp.FirstRecord; var
divId = bcEmp.GetFieldValue("Division Id");