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", ...

Get Dynamics 365 Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.