To create a record in Dynamics with Xrm.WebApi the syntax below can be used. In the example below we create an account record with multiple fields about the account and a reference to a primary contact of the account.
let data = {
"name": "Litware Publishing",
"description": "An example account created with Xrm WebApi.",
"telephone1": "+09-70-01-90-90",
"address1_line1": "39, quai du Roosevelt",
"address1_city": "Paris",
"address1_postalcode": "address1_postalcode",
"address1_country": "France",
"primarycontactid@odata.bind": "/contacts(53a0e5b9-88df-e311-b8e5-6c3be5a8b200)",
}
// Create account record
await Xrm.WebApi.createRecord("account", data).then(
function success(result) {
console.log("Account created with ID: " + result.id);
},
function (error) {
console.log(error.message);
}
);
In the image below it show how it looks when running the script in the developer console in the browser.
Image of how the script looks when creating an account record in Dynamics 365 with a primary contact.
How I use Claude’s Excel add-in together with Easy Translator from XrmToolBox to translate and clean up Dynamics 365 labels. From export to import in minutes instead of hours.
I needed to set up an environment settings file for a Power Platform pipeline the other day. The file tells Azure DevOps which connections to use when deploying a solution — and to fill it in, you need the connection ID for each connection reference. The standard approach is to go into make.powerapps.com, click Connections …
I needed to update a couple of Power Automate flows the other day. Then it hit me: the Power Automate Tools browser extension copies flows as JSON — and JSON is something Claude handles really well. So I tried it. Copied the flow JSON, pasted it into Claude inside my Dynamics 365 Architect project, described …