CRUD operations with Xrm.WebApi.online.execute and Xrm.WebApi.online.executeMultiple

CRUD (create, read, update, delete) operations using the Xrm.WebApi.online.execute and Xrm.WebApi.online.executeMultiple methods of the Dynamics 365 Client API, with JavaScript, are not very well documented in the official Microsoft documentation. The Xrm.WebApi.online.execute (Client API reference) documentation has no code samples for CRUD opertations.

So, here are code samples to get you going…

CRUD Opertations with Xrm.WebApi.online.execute

Below are some code samples for running CRUD operations using the Xrm.WebApi.online.execute method.

Create

Retrieve

Update

Delete

CRUD Opertations with Xrm.WebApi.online.executeMultiple

Below are some of code samples for running CRUD operations using the Xrm.WebApi.online.executeMultiple method.

Note: As per the OData v4 specifications, you cannot include read operations as part of a change set.

Create

Retrieve

Update

Delete

Sources

Sample code derived from pending pull request #626.

All views expressed in my blog are my own and do not represent the opinions of any entity whatsover with which i have been, am now, or will be affiliated.