Bookshelf Home | Contents | Index | PDF |
Oracle CRM On Demand JavaScript API Developer's Guide > JavaScript API Code Samples > Code Sample for a Custom Button That Creates a RecordThe following code sample illustrates the use of the createRecord() method to create an Account record with three fields, Location, Type, and Description, when a button created with the createButton() method and labeled if(oraclecrmod.ctx.isObject("Account") && oraclecrmod.ctx.isDetailPage()) var callback = function(request,response) data += "Id = " + response.getRowId() + ", Mod Id = " + response.getModId(); alert(data + "\n" + status + "\n" + error); oraclecrmod.dataSvc.createRecord("Account", {Name : "Account Name Create123",Location : "Location Test", Type : "Customer", Description : "Description Test"}, "", callback); var tb = oraclecrmod.getTitleBar("AccountFormTB"); var bt = oraclecrmod.createButton({id:"TestCreateBtn",text:"Test Create",parent:tb}); |
Oracle CRM On Demand JavaScript API Developer's Guide, Release 38 | Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Legal Notices. | |