Siebel Developer's Reference > Operators and Expressions > Expressions >

Using the Division Functions


This topic includes examples that use the division functions.

Using the Division Name Function to Display the Division Name

This example describes how to create a calculated field that displays the division name of the user who is currently logged in. If this user creates a service request, then Siebel CRM displays this field.

To use the DivisionName function to display the division name

  1. In Siebel Tools, in the Object Explorer, click Business Component.
  2. In the Business Components list, locate the Service Request business component.
  3. In the Object Explorer, expand the Business Component tree, and then click Field.
  4. In the Fields list, create a new field using values from the following table.
    Property
    Value

    Calculated

    TRUE

    Calculated Value

    DivisionName()

    Name

    Division (Calc)

    Parent Name

    Service Request

    Type

    DTYPE_TEXT

  5. In the Fields list, create another new field using values from the following table.
    Property
    Value

    Column

    ATTRIB_03

    Join

    S_SRV_REQ_X

    Name

    Reported By Division

    Pre Default Value

    Field: 'Division Name'

    Read Only

    TRUE

  6. Display the field you created in Step 5 in the relevant applets.

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");

Siebel Developer's Reference Copyright © 2016, Oracle and/or its affiliates. All rights reserved. Legal Notices.