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

230
Views
In dynamics-web-api, when using batch, how to use content-id as a key of an update request?

Npm package: https://www.npmjs.com/package/dynamics-web-api

Version: 1.6.12

this.dynamicsWebApi.startBatch();
this.dynamicsWebApi.createRequest({
  collection: 'accounts',
  entity: createdAccountData,
  contentId: '1',
});
this.dynamicsWebApi.createRequest({
  collection: 'contacts',
  entity: {
     ...contactData,
     'parentcustomerid_account@odata.bind': '$1',
  },
  contentId: '2',
});
this.dynamicsWebApi.updateRequest({
  collection: 'accounts',
  key: '$1',
  entity: {
    'aw_Dashboard_Contact@odata.bind': '$2',
  },
});
await this.dynamicsWebApi.executeBatch();

From the above code, I intend to create an account, a contact that links to the account, and finally, update the account to link to the contact.

CreateRequest 1 and 2 could execute successfully, but the updateRequest failed with the error message "DynamicsWebApi.executeBatch requires the request.key parameter to be of type String representing GUID or Alternate Key"

My question is that there is any way to use the contentId 1 as the key of the updateRequest?

about 4 years ago · Santiago Gelvez
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!