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,...
Suggested Answer

create multiple Entitys in a single request from a plugin

(0) ShareShare
ReportReport
Posted on by

I have a general question around efficiency and best practice. 

I have read on the Microsoft forum that I should avoid using ExecuteMultipleRequest in my plugins at all costs however it seems to me that its far less efficient to make say 10 calls when 1 call would do, so far my plugin has been working fine without issue however now I'm attempting another creation I'm hitting issues.

For example i have a plugin that updates the opportunity record with opportunityproduct(s), in this example I'm updating with 10 products,

i use ExecuteMultipleRequest to create the product entities in one transaction,
i use ExecuteMultipleRequest to set the state / status of the product entities (SetStateRequest) in one transaction,
i use ExecuteMultipleRequest to create productpricelevel entities 

- so far this process has taken between 3,000 - 3,531 ms 

I then use ExecuteMultipleRequest to create the Opportunityproduct entities in one transaction (there are only 10 records to create)

- plugin execution time drastically jumps to 120,036 causing time out error.


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

    Hello,

    Can you please provide a source where you read about the usage of ExecuteMultiple from plugins?

    It makes no sense because:

    1. Plugin is executed in transaction itself.

    2. Plugin's code is executed near-door to the Api of Dynamics, so there are no losses with travel time.

    My recommendation - don't use ExecuteMultiple from plugins. It makes sense to use it from other apps but not from plugins.

  • RyanCRM Profile Picture
    on at

    This is where i read that ExecuteMultiple should not be used from within a plugin - docs.microsoft.com/.../avoid-batch-requests-plugin

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Let me re-read that for you.

    1. You read that ExecuteMultiple shouldn't be used from within a plugin.

    2. You develop a plugin and use ExecuteMultiple, your plugin hit the timeout error.

    3. You create a post here describing your issue.

    Doesn't it look for you contradictory?

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 144 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 59

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans