Oracle CRM On Demand JavaScript API Developer's Guide > JavaScript API Reference > Methods for the Form Object >

Callback Handler for the commitValues() Method


When the commitValues() method completes processing, and if there is an error, a custom error callback handler is called.

The callback handler returns a JSONObject, which has the following properties:

  • status. The status as a string: "OK" or "ERROR".
  • errors. Any errors in a JSONArray object. The errors object specifies null or an array of objects in the following format:

{

fac : "error code",

msg : "error message"

}

There are two types of error:

  1. Errors where validation failed on the JavaScript side.

    In this case, the error code is one of:

    • OCCAM_JS_INLINE_FIELD_REQUIRED
    • OCCAM_JS_INLINE_TEXT_TOO_LONG
    • OCCAM_JS_INLINE_INVALID_FORMAT

      The error message has the format: %Field_Name% : %Failed_Reason%

  2. Errors returned from the OM side.

    In this case, the error code has the format SLB-XXX-XXXXX, and the error codes and messages are similar to those described in CRUD Error Codes and Messages.

For information about handling errors in your code, see Errors and Error Handling.

The callback handler is not only an error handler, it is also where your logic resumes.

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