Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
Create an Entity Record using "Xrm.WebApi.createRecord" in JS- Dynamics 365

I was trying to create an entity record using Xrm.WebApi.CreateRecord but I'm getting the following error.

"cannot find record to be updated"

please note that the field 'edm_donorid' exists in the form and the ID that I'm using to fill the fill also exists in the contacts.

var entity = {};
var type = result["_edm_donorid_value@Microsoft.Dynamics.CRM.associatednavigationproperty"];

if (type == "edm_DonorID_contact") {
    entity["edm_DonorID_contact@odata.bind"] = "/contacts(" + result["_edm_donorid_value"] + ")";
}
else if (type == "edm_DonorID_account") {
    entity["edm_DonorID_account@odata.bind"] = "/accounts(" + result["_edm_donorid_value"] + ")";
}

opener.Xrm.WebApi.createRecord("edm_bookreceiptdetail", entity)
    .then(function success(record) {
        console.log("record created with ID: " + record.id);
        // perform operations on record creation
    },
        function (error) {
            console.log(error.message);
            // handle error conditions
        }
    );
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I found the problem and I fixed it.

"cannot find record to be updated" error comes when I disregarded filling fields that have a relation with another entity.

so, make sure to fill every mandatory field or fields related to any other entities when you create an entity record using JS.

Amer Azzam, Microsoft Dynamics 365 Developer

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!