dear all
i am trying to run this sample code when saving a record (custom entity record), but i am getting error, can you help please.
// define the data to create new account
function create_new_account() {
var data =
{
"name": "Sample Account",
"creditonhold": false,
"address1_latitude": 47.639583,
"description": "This is the description of the sample account",
"revenue": 5000000,
"accountcategorycode": 1
}
// create account record
Xrm.WebApi.createRecord("account", data).then(
function success(result) {
console.log("Account created with ID: " + result.id);
// perform operations on record creation
},
function (error) {
console.log(error.message);
// handle error conditions
}
);
}
error :
_______________________
create_new_account@win-agqoeadqke1/.../new_create_sample_account
@win-agqoeadqke1/.../ClientApiWrapper.aspx line 157 > eval:1:1
RunHandlerInternal@win-agqoeadqke1/.../ClientApiWrapper.aspx
RunHandlers@win-agqoeadqke1/.../ClientApiWrapper.aspx
ExecuteHandler@win-agqoeadqke1/.../ClientApiWrapper.aspx
$Cb_1@win-agqoeadqke1/.../formcontrols.js
executeHandler@win-agqoeadqke1/.../formcontrols.js
executeHandlerByDescriptor@win-agqoeadqke1/.../formcontrols.js
getHandler/<@win-agqoeadqke1/.../formcontrols.js
getHandler/<@win-agqoeadqke1/.../global.ashx
$Dd_1@win-agqoeadqke1/.../formcontrols.js
$LI_1@win-agqoeadqke1/.../formcontrols.js
saveInternal@win-agqoeadqke1/.../formcontrols.js
save@win-agqoeadqke1/.../formcontrols.js
save@win-agqoeadqke1/.../formcontrols.js
Mscrm.CommandBarActions.saveForm@win-agqoeadqke1/.../commandbaractions.js
Mscrm.RibbonActions.saveForm@win-agqoeadqke1/.../ribbonactions.js
Mscrm.Utilities.executeJavascriptFunction@win-agqoeadqke1/.../global.ashx
$Cf_1@win-agqoeadqke1/.../ribbon.js
$Ag_1@win-agqoeadqke1/.../ribbon.js
handleCommand@win-agqoeadqke1/.../ribbon.js
executeCommand@win-agqoeadqke1/.../ribbon.js
executeCommand@win-agqoeadqke1/.../ribbon.js
click@win-agqoeadqke1/.../ribbon.js
onClickHandler@win-agqoeadqke1/.../ribbon.js
Function.createDelegate/<@win-agqoeadqke1/.../MicrosoftAjax.js
b@win-agqoeadqke1/.../MicrosoftAjax.js
*This post is locked for comments