Create Record:
<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
var entityData =
Let’s
see how we can create a “Lead” record using newly introduced
Web API calls in Dynamics 365 V9
Web API calls in Dynamics 365 V9
Xrm.WebApi.createRecord(“entityLogicalName”,data).then(successCallback,errorCallback);
// This line of code is required if you are creating from HTML webresource.
<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>
{
"subject": “leadFromWebApi”,
"lastname": “Ram”
}
Xrm.WebApi.createRecord("lead", entityData).then(
function success(result)
{
alert("Record
Created successfully and Id is: " + result.id);
console.log("Account
created with ID: " + result.id);
},
function (error)
{
console.log(error.message);
});
0 comments:
Post a Comment