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

Methods for the Form Object


Table 6 shows the methods that are available for the Form object. These methods are used, together with the field.setColor() and field.getColor() methods in the color coding of fields in Detail and Edit pages. For more information about the setColor() and getColor() methods, see Table 5.

Table 6. Methods for the Form Object
Method Name
Return Type
Description
Sample Code
Notes

on(event,customfunction)

this

Registers a custom handler for the form.

form.on("display", myColorHandler);

The custom handler is automatically executed when the form initially loads or refreshes due to any other actions on the screen such as inline editing.

The event parameter must be "display". If not, it is ignored and the custom handler is not registered.

off(event)

this

Removes the custom handler for the form.

form.off("display");

If the event parameter is not "display", it is ignored and the custom handler is not removed.

commitValues(callback)

JSONObject in callback

Commits values set on Detail pages using the setValue() method.

oraclecrmod.getForm().commitValues(callback);

For information about the callback handler, see Callback Handler for the commitValues() Method.

getId()

String

Returns the row ID of the record on the screen.

oraclecrmod.getForm().getId();

The getId() method is supported for Detail and Edit pages. For other types of pages, including New pages, it returns null.

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