Bookshelf Home | Contents | Index | PDF |
Oracle CRM On Demand JavaScript API Developer's Guide > JavaScript API Reference > Errors and Error HandlingFor CRUD operations, the errors object specifies null or an array of objects in the following format: fac : "SBL-ODU-MSG_NUMBER", // error code msg : "MSG_TEXT" // error message For example, for response.errors[0]: msg : "Invalid value for the parameter:objectName." Example Code of How to Deal with the Error ObjectYou must implement your own error handing in custom JavaScript code. As an example of how to deal with the error object, the following is a callback function that displays error codes and error messages from CRUD operations. function callback(request,response){ error += response.errors[0].fac + "\n" + response.errors[0].msg; data += "Id = " + response.getRowId() + ", Mod Id = " + response.getModId(); alert(data + "\n" + status + "\n" + error); A guideline is to use the error code in error handling rather than the error message. This is recommended because the error code is language independent, but the error message is not. Code like the following only works in English: if (response.errors[0].msg == "No records found") CRUD Error Codes and MessagesTable 15 shows some error codes and messages that might be returned.
|
Oracle CRM On Demand JavaScript API Developer's Guide, Release 34 | Copyright © 2017, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |