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

Create Record:

Let’s see how we can create a “Lead” record using newly introduced
 Web API calls in Dynamics 365 V9
// This line of code is required if you are creating from HTML webresource.

<script src="ClientGlobalContext.js.aspx" type="text/javascript"></script>

var entityData =

                    "subject": “leadFromWebApi”,
                    "lastname": “Ram”

Xrm.WebApi.createRecord("lead", entityData).then(
                    function success(result)
                        alert("Record Created successfully and Id is: " +;
                        console.log("Account created with ID: " +;
                    function (error)

1 comment:

  1. This site has lots of advantage awesome i really enjoyed reading thanks for sharing for grate info .we are also providing Save Time & Money with the all new local calfre search engine! this search engine can track all educational training institutes websites data,can find mobile numbers,everything just type one realated to ur course keyword training


Popular Posts