Oracle CRM On Demand JavaScript API Developer's Guide > JavaScript API Reference >

Methods for the oraclecrmod Object


This topic describes the methods for the top-level object, oraclecrmod. Table 1 lists the methods associated with events.

Table 1. Methods for oraclecrmod That Are Associated with Events
Method Name
Return Type
Description
Sample Code

onReady(customFunction)

oraclecrmod

Registers a custom function that is executed by the framework when the DOM tree is constructed. This method is the entry point for running custom code.

oraclecrmod.onReady(function()

{

oraclecrmod.createButton({...});

});

onLoad(customFunction)

oraclecrmod

Calls a custom JavaScript function when the onload event is triggered for the document body.

This method is similar to onReady(), but it is rarely used because the onReady() method is preferred.

oraclecrmod.onLoad(onLoadFun);

onUnload(customFunction)

oraclecrmod

Calls a custom JavaScript function when the onunload event is triggered for the document body.

oraclecrmod.onUnload(onUnloadFun);

Table 2 lists the methods that are associated with UI components. The getTitleBar() and getButton() methods use the ID of the title bar or button as a parameter. For information about how to find these IDs, see Identifying the IDs of Buttons and TitleBars.

Table 2. Methods for oraclecrmod That Are Associated with UI Components
Method Name
Return Type
Description
Sample Code and Notes

getTitleBar(Id)

TitleBar

Returns a TitleBar instance referenced by the Id parameter. You can use this TitleBar instance to add another button to the TitleBar.

var tb = oraclecrmod.getTitleBar("TitleBarId");

oraclecrmod.createButton(

{id:"TestBtn",text:"Text Button",parent:tb});

getButton(Id)

Button

Returns a Button instance referenced by the Id parameter.

This method can retrieve both preconfigured buttons and custom buttons.

var btn = oraclecrmod.getButton("ButtonId");

createButton (config)

Button

Creates a custom button. You can call this shortcut method to create a button, instead of using code like the following:

new oraclecrmod.component.Button(config);

The config parameter has the following properties:

  • id. The ID of the button (String).
  • text. The display text of the button (String).
  • img. The URL of the image used by the button (String).
  • disabled. Whether the button is disabled (Boolean).
  • display. Whether the button is displayed (Boolean).
  • toolTipText. The text to be displayed in the tooltip of the button (String).
  • toolTipFormat. The format of the tooltip text to be displayed (HTML or Plain Text, which is the default).

oraclecrmod.createButton({

id:"MyBtnId",

text:"Click to Invoke",

img:"images/yourimage.gif",

disabled:false,

toolTipText:"<p>Click this</p>",

toolTipFormat:"HTML"});

Null is returned if a call to createButton() fails. This return value might result, for example, from trying to create a button that has a duplicate ID.

For more information about tooltip formatting, see Considerations for Specifying Tooltips with HTML Formatting.

registerButtonToolTip (tooltipInfoList)

 

Registers tooltips for a set of buttons in one call.

The input object is an array of button names and the associated tooltip text and tooltip format for each button.

For more information about tooltip formatting, see Considerations for Specifying Tooltips with HTML Formatting.

var tooltipInfoList = [

["BTN_TB_AccountForm_AccountNewNav","<p>Helps to create new account</p>","HTML"],

["BTN_TB_AccountForm_AccountEditNav","Helps to edit the existing account", "Plain Text"],

["BTN_TB_AccountForm_AccountPreCopyNav","Helps to copy this account and create new one", "Plain Text"]

];

oraclecrmod.registerButtonToolTip(tooltipInfoList);

getList(listname)

List

Gets a List object on a List or Detail page, on which a custom display handler can be registered or unregistered.

The List object is the starting point for getting Row objects from the list, and Field objects from rows. For more information, see Methods for the List Object.

listObj = oraclecrmod.getList("AccountList");

listObj = oraclecrmod.getList("AddressChildList");

listObj = oraclecrmod.getList();

If there are no lists with the listname value on the screen, null is returned.

In full list pages there is only one list, so the listname parameter can be omitted.

For information about finding list names, see Finding List Names.

getForm()

Form

Gets a Form object on an Edit or Detail page, on which a custom display handler can be registered or unregistered.

For more information, see Methods for the Form Object.

oraclecrmod.getForm();

If there is no Form object on the screen, then null is returned.

If getForm() is used, for example, on a homepage or list page, null is returned.

Oracle CRM On Demand JavaScript API Developer's Guide, Release 38 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Legal Notices.