web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Execute batch operations using the Web API

(0) ShareShare
ReportReport
Posted on by 157

Hello,

I am referring to this Documentation about batch requests. Can we create multiple records that are related to different entities in the same request?

For example: Create the Sales Order and Sale Order Products.

Thank You,

Eman

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello Eman,

    Check this - docs.microsoft.com/.../create-entity-web-api

  • Verified answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    Thank yo for your query. If you mean to create Sales order and related products in one go, that will not work. Sales Order header must be created before order products. That means, your batch must have multiple change sets (one for the order header and one for lines).

    In a batch we can have multiple change sets and read operations, your batch structure would look like this:

    • <batch_unique_id>
      • Change Set 1 (Create Sales Order here).
        • Order 1
        • Order 2
        • Order N
      • Read Operation (Get created orders)
      • Change Set 2 (Create Sale Order Products based on the Sales Order IDs retrieved).
        • Order Product 1
        • Order Product 2
        • Order Product N

    Here is a very nice post for your reference:

    Execute Web API Batch Operations Without ExecuteMultiple – Implementing Tae of <T> (taerimhan.com)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans