Table 137. Functions Used in Calculated Expressions
|
|
|
|
|
|
|
Returns the current user's Account ID (OU_ID). |
|
|
|
Returns the contact ID of the currently logged in user. If you do not use the contact login method for a Web-based application, the function cannot retrieve any value and returns an empty string. It is recommended that you use the contact login method and an external security authentication service (for example, LDAP). |
|
|
|
Returns the number of rows in the multi-value group defined by the MVL mvlink. |
|
|
|
Returns the currency code for the current position (for example, USD). |
|
|
|
Returns the current user's Division ID (BU_ID). To limit visibility to employees from the same division as the person logged in, add the following to the search specification property of the Applet: [Division Id] = DivisionId() |
|
|
|
Returns the division name of a user who is an employee. Use to limit visibility to employees from the same division as the person logged in. Also use to display the division name of the user logging the service request. Create a new calculated field so that, when the service request is created, the calculated field displays the division name of the current logged user that is creating the service request. Using the following configuration, the new joined field Reported By Division will be predefaulted to this value, and will never receive another value after this service request creation event. |
To create a calculated field that displays the division name of the current logged user creating a service request:
- In the Service Request business component, create a new calculated field:
Calculated: TRUE Calculated Value: DivisionName() Name: Division (Calc) Parent Name: Service Request Type: DTYPE_TEXT
- In the Service Request Business Component, also create a new join to S_SRV_REQ_X table:
Column: ATTRIB_03 Join: S_SRV_REQ_X Name: Reported By Division
|
DivisionName () ( continued) |
|
|
Pre Default Value: Field: 'Division Name' Expose the joined field Reported By Division in the relevant applets. You may also want to expose the calculated field Division (Calc), just to check the logic and set Visible = False later for the control or list column exposed. |
|
|
|
IIf(EXISTS( [Participant-Employee Login] = LoginName()), "Y", "N"). |
GetProfileAttr (" Attribute") |
|
|
Returns the value stored in the profile attribute if that attribute has been defined. Used in personalization to retrieve values of attributes in a user profile and to pass information from a script to the UI. Set a session-specific personalization attribute equal to the value of the shared global and reference the personalization attribute in a calculated field. NOTE: For an undefined attribute or for an attribute that has not been set up, GetProfileAttr returns NULL. This is important when you are using comparison operators. For example:
- GetProfileAttr("Attribute") = "" always returns FALSE either if the Attribute does not exist or exists and the value is different than "".
- GetProfileAttr("Attribute") IS NULL returns TRUE if the Attribute does not exist and FALSE otherwise.
|
|
|
|
Returns the value of expr1 unless expr1 is NULL, in which case the value of expr2 is returned. |
IIf ( testExpr, expr1, expr2) |
|
|
If testExpr is TRUE, returns the value of expr1; otherwise returns the value of expr2. NOTE: If working with DTYPE_NUMBER fields, the Data Type of expr1 determines the Data Type of the resulting value. |
InvokeServiceMethod ("[ServiceName]", "[MethodName]", "[InputProp1=val1, InputProp2=val2]", "[OutputProp") |
|
|
Invokes a business service from a calculated field and returns [Output Prop]. NOTE: Do not expose a calculated expression that invokes a business service in a list applet. Doing so may result in poor performance because the business service will be repeatedly instantiated each time the field appears in the list. |
|
|
|
Returns the Job Title of the currently logged-in employee. Similar to PositionId () and DivisionId (). |
|
|
|
Equal to the Oracle (and Sagent) Julian Day, for all dates in the 20th and 21st centuries. |
|
|
|
Equal to the JulianYear() * 12 + currentMonth, where January = 1. |
|
|
|
Equal to the JulianYear() * 4 + currentQuarter, where currentQuarter = (currentMonth - 1) / 3 + 1 rounded down to the next integer. |
|
|
|
JulianDay() / 7, rounded down to the next integer. |
|
|
|
Equal to the current year + 4713. |
|
|
|
Returns the language code (for example, ENU) which is the active client language setting, set by the Language parameter in the CFG file, or by the /L parameter when starting a Siebel application. NOTE: This is not the Resource Language parameter. |
|
|
|
Returns the leftmost n characters in the text string or field. For example, Left ("Adams", 2) returns "Ad." |
|
|
|
Returns the length of a string or string variable. The number of characters is specified between parentheses. |
|
|
|
Returns the currency code for this machine (for example, JPY). |
|
|
|
Login ID (for example, 0-3241). |
|
|
|
Login name (for example, BSTEVENS). |
|
|
|
Finds a row in S_LST_OF_VAL where the TYPE column matches the type argument and the VALUE column matches the value argument. The function returns the value of the ORDER_BY column for that row. The primary purpose of the Lookup function is to avoid additional joins in a business component. |
LookupExpr ( type, value_expr) |
|
|
Searches the rows in S_LST_OF_VAL where the TYPE column matches the type argument. Evaluates the contents of the VALUE column treated as an expression. Returns the value of the ORDER_BY column for the first row for which the expression evaluates to TRUE. The LookupExpr function essentially performs an in-memory linear parse evaluate search, so you should make sure that there are fewer than 30 rows in the LOV type. |
LookupName ( type, lang_ind_code) |
|
|
Finds a row in S_LST_OF_VAL where the TYPE column matches the type argument, the CODE column matches the lang_ind_code argument, and the LANG_ID column matches the language code of the currently active language. Returns the language-independent code (the CODE column) for the row. This function is used to obtain the untranslated value in the specified LOV. |
LookupValue ( type, lang_ind_code) |
|
|
Finds a row in S_LST_OF_VAL where the TYPE column matches the type argument, the CODE column matches the lang_ind_code argument, and the LANG_ID column matches the language code of the currently active language. Returns the display value (the VAL column) for the row. LookupValue tries to find the display value for the specified lang_ind_code. If not found, LookupValue just returns the lang_ind_code itself as the value. This function is used to obtain the translation of the specified untranslated value in the specified LOV into the currently active language. NOTE: The LookupValue() function cannot be used directly in the Pre Default Value property of a field. Instead, use a separate calculated field for the lookup, and reference the calculated field in the Pre Default Value property of the original field. |
|
|
|
Returns the organization ID of the currently logged in user. |
|
|
|
Returns the organization name of a user who is an employee. |
|
|
|
Parent (master) business component name for active link (for example, Opportunity). |
ParentFieldValue ( field_name) |
|
|
Returns the value of the field_name field in the parent business component. The result is not typed correctly but is always of type String. Also, the result does not change if the parent row is updated. The parent business component field must be exported by using Link Specification = TRUE. |
|
|
|
Position ID of currently logged-in employee (for example, 0-4432). |
|
|
|
Position name of currently logged-in employee. |
|
|
|
Returns the right-most n characters in the text string or field. For example, Right ("Adams", 2) returns "ms" |
|
|
|
Converts an alphanumeric row ID to a unique, pure numeric row ID in the Service Request business component. In Siebel eBusiness 6. x, this expression has changed functionality; it is used for the predefault value of the "SR Number" field. |
|
|
|
Sums the values from a field in child records into a field in a parent record. The child record being summed from must be defined as a multivalue field that is part of a multi-value group that is associated with the business component of the field being summed to. |
ToChar ( num_expr, format) |
|
|
Returns a string that represents a number or date in a format specified by the optional format parameter. (For example, ToChar (10, "##.##") returns "10.00"). |
|
|
|
Today's date and time (for example, 01/02/96 11:15:22). The Timestamp function can also be used in queries. For example: Created >= Timestamp() - 0.1
against an MS SQL Server database would return those records created within the last one-tenth of a day. |
|
|
|
Today's date (for example, 1/26/96). |