O'Reilly logo

Dynamics 365 Application Development by Nishant Rana, Deepesh Somani

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CRUD operations using Dynamics 365 Web API

We will look at some basic examples for creating, updating, retrieving, and deleting an entity.

Create an entity

The following is a code for Web API that creates a new record for the entity account. For that first, we will create a JSON object and set the required properties:

//Creates a JSON object for an Entity to be created.var entity = {};//Sets the properties for entity.entity.accountnumber = "AC1009348YU";entity.name = "Shree Technosoft";entity.telephone1 = "9978759612";var req = new XMLHttpRequest();req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/accounts", true);req.setRequestHeader("OData-MaxVersion", "4.0");req.setRequestHeader("OData-Version", "4.0");req.setRequestHeader("Accept", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required