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***

2 comments:

  1. Looking great article with useful content, thanks for posting please do keep updating...
    Best Online Software Training Institute | HTML JavaScript Training

    ReplyDelete
  2. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time.

    CEH Training In Hyderbad

    ReplyDelete

Popular Posts