Hi,
In CRM Online, I'm trying to build a button to open a "quick create form" from the "Customer Assets" forms which will open the "Case" Quick Creation form in the screen.
I sadly can't get my button to work from the button (nothing happens on the screen) so I tried to add the code to the "OnLoad" of the form and it's throwing an error.
I was wondering if someone has a clue on what I'm doing wrong, here is the code I'm trying to execute, I took the examples from internet and added the function "OpenQuickCreateCase()" which I'm calling either from the button Command or from the OnLoad when I'm trying to test the code. :
//lookup object of current account record function openQuickCreateCase() { var custAsset = { entityType: “msdyn_customerasset”, id: Xrm.Page.data.entity.getId() }; var parameters = {}; // *** Call the Xrm.Utility needed to add a contact. Xrm.Utility.openQuickCreate("incident", custAsset, parameters).then(function (lookup) { successCallback(lookup); }, function (error) { errorCallback(error);}); } // *** Function called on success. function successCallback(lookup) { alert("lookup: " + lookup.savedEntityReference.id); alert("lookup: " + lookup.savedEntityReference.name); } // **** Function called on error. function errorCallback(e) { alert("Error: " + e.errorCode + " " + e.message); }
Thanks in advance for your help!
*This post is locked for comments