Updating a record from JavaScript using the Xrm.WebAPi in Dynamics 365 V9

Summary : Updating a record from JavaScript using the Xrm.WebAPi in Dynamics 365 V9


Now let’s update a record
Syntax: Xrm.WebApi.updateRecord(entityLogicalName, id, data).then(successCallback, errorCallback);

***Code starts here***

var entityData =
                {
                    "subject": “leadFromWebApi_Updated”,
                    "lastname": “RamLaxman”
                }

Xrm.WebApi.createRecord("lead", id, entityData).then(
                    function success(result)
                    {
                        alert("Record updated successfully ");                      
                    },
                    function (error)
                    {
                        console.log(error.message);       
                    });
***Code ends here***

4 comments:

Popular Posts