Bookshelf Home | Contents | Index | PDF |
Oracle CRM On Demand JavaScript API Developer's Guide > JavaScript API Reference > Methods for CRUD OperationsThis topic describes the methods available for create, read, update and delete (CRUD) operations on off-screen records. Table 11 lists the methods, which are under oraclecrmod.dataSvc. The parameters for the methods are discussed in Parameters and Return Values for CRUD Methods. For a code sample that performs a create operation, see Code Sample for a Custom Button That Creates a Record. For the CRUD operations, only top-level record types are supported and not child-level record types. To access child-level record types, you can use the Oracle CRM On Demand REST API. For more information, see Oracle CRM On Demand REST API Developer's Guide. To handle the results of a CRUD operation you must define a callback function as described in User-Defined Callback Function. TIP: All of the methods run asynchronously, so you must implement the callback function and subsequent function calls to allow for this. The methods are asynchronous because CRUD operations need to communicate with the server to complete and this involves remote communication across the network using AJAX technology. Because of this, these operations normally take a significantly longer time to complete compared to other operations that happen inside the browser. In the browser, all the JavaScript code runs in a single thread. If synchronous calls were used for the CRUD operations, the browser would not be able to handle any user interaction when the CRUD operations were in process. Asynchronous calls are therefore used for CRUD operations. During the CRUD operations the user can still interact with the page, and when the operation is finished, the framework calls the callback function to handle the result. This results in a much better user experience.
For create and update operations on required and read-only fields in off-screen records, only default preconfigured fields and not custom fields are supported. If a preconfigured required field is missing, then the create or update operation fails. If an operation attempts to populate a read-only field, then it is ignored. |
Oracle CRM On Demand JavaScript API Developer's Guide, Release 36 | Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |