Methods for the Context Object
You can get information about the current page and logged-in user to make decisions in your custom JavaScript code, for example, to determine when a script executes.
The methods shown in the following table are helper functions that wrap the attributes for the context object shown in the second table. As a guideline use the helper methods, which are more convenient than using the attributes directly because they return Boolean values. If you use an attribute directly, then you have to do a comparison, such as the following:
if(oraclecrmod.ctx.pageType == "D")
Whereas using a helper method like the following is simpler and clearer:
if(oraclecrmod.ctx.isDetailPage()
Method Name | Description | Parameters and Notes |
---|---|---|
isHomePage |
Returns whether the current page type is Homepage |
None |
isListPage |
Returns whether the current page is a List page |
None |
isDetailPage |
Returns whether the current page type is Detail page |
None |
isEditPage |
Returns whether the current page type is Edit page |
None |
isNewPage |
Returns whether the current page type is New page |
None |
isEditOrNewPage |
Returns whether the current page type is Edit page or New page |
None |
isAdminPage |
Returns whether the current page type is Admin page |
None |
isObject(object) |
Returns whether the current page’s primary object is the record type in the parameter |
The String object parameter is the record
type, for example: |
All of the helper methods have a Boolean return type. The following table shows the attributes for the context object.
Attribute | Type | Description | Sample Values and Code |
---|---|---|---|
servlet |
String |
The current servlet path. |
|
pageType |
String |
An alphabetic character representing the current page type. |
|
object |
String |
The current record type name. |
|
layoutId |
String |
The row ID for the current layout in use, which you can find in the URL of the Page Layout Wizard editing page. For a standard layout, the URL has no row ID, and this attribute has the value of the standard layout name. |
|
layoutName |
String |
The display name for the current layout. |
|
roleId |
String |
The row ID for the current user’s role, which you can find in the URL of the Role Management Wizard editing page. |
|
roleName |
String |
The name of the current user role, unlocalized |
|
lang |
String |
The current user’s language as a three-character code Note: See Oracle Migration Tool On Demand Guide for a list of the language codes supported for Oracle CRM On Demand. |
|
userId |
String |
The user ID of the currently logged-in user. |
|
userCountryLIC |
String |
The country (LIC value) of the currently logged-in user. |
|
userEmail |
String |
The email of the currently logged-in user. |
|
userAlias |
String |
The user alias of the currently logged-in user. |
|
userFullName |
String |
The full name of the currently logged-in user. |
|