Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Execution Order and Stage VS Multiple plugins on same CRUD operation and Entity

Posted on by 355

I created several plugins and registered them with the Plugin Registration Tool. Some of them are associated to the same CRUD operation and primary entity.
It's not clear to me how should I set the Execution Order and the Event Pipeline Stage of Execution: should I set different values for the multiple plugins associated to the same CRUD method and entity?

For example, I have a plugin called CheckFields, it ensures that the required fields are not null. I registered it by setting "Movie" as Primary Entity, "Create" as Message, "1" as Execution Order and "PreValidation" as Event Pipeline Stage of Execution.

I have another plugin called "IncrementCode", it assigns a default code to new records. It's associated to the entity movie too and it's triggered by the CREATE operation too, so the values for Message" and Primary Entity are the same.

To avoid conflicts, should I assign different values for the Execution Order and/or the Event Pipeline Stage of Execution? And why?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Execution Order and Stage VS Multiple plugins on same CRUD operation and Entity

    If you need them to both run in the PreValidation stage then its ok to keep them there.

    The execution order is the one to change here, 1 = first one to run, 2 = second, etc.

    I think the better question is, if they are on the same event would it make sense to it to be 1 plugin with both actions taking place?  IE: 1 plugin step registered firing and inside the code calling 2 different methods to complete your process.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans