I have 2 plugins that have method service.create , i would like to block one of them when the other is running because the first one create record and call to service.create and the second hav message create
I have 2 plugins that have method service.create , i would like to block one of them when the other is running because the first one create record and call to service.create and the second hav message create
Hey,
Based on what you're saying you have two plugins registered on Contact Create, Plugin A and Plugin B. Plugin B may create a contact and then you dont want Plugin A to be executed - is that right?
If it is, you should be looking at the context.Dpeth in the first Plugin - it tells you how deep you are in the rabbit hole, or how many plugins\workflows kicked off before this one. You can even check the ParentContext to ensure it was kicked off by Plugin B.
community.dynamics.com/.../ms-crm-ipluginexecutioncontext-depth-a-detailed-look-plugintip1
Good luck,
E
Hi,
If I am correctly understood ,you can create dummy two options field in the entity , and set value true or false while creation.
Another plugin you simply check the field value and based on that execute or return from your code.
You can also try to check context depth and also pass shared variable and set return on plugin which you don't want to execute.
first plugin triggered when contact was created , the seconde create contact , i dont like to the seconde call to the first
Hi
You should be able to set the order of the execution by setting the SDK Message Process Step execution order,
"Execution order in plugin specifies the order, also known as rank, that plug-ins are executed within a pipeline stage. Plug-ins registered with an order value of 1 are executed first, followed by plug-ins registered with an order of 2, and so on. However, if there is more than one plug-in in a stage with the same order value, then the plug-in with the earliest compilation date is called first"
Please follow the links below
[View:https://community.dynamics.com/crm/b/exploringdynamics365/archive/2017/10/16/workflow-or-plugin-which-one-will-run-first:750:50]
Please explain in detail with some example.
BTW you can not disable/cancel a plugin dynamically but work around is there.
Please explain in detail with some example.
BTW We can not disable/stop a plugin dynamically but work around is there.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156