Hi all,
I created two plugins that should be fired on the post-update of an invoice. I considered this thread: https://community.dynamics.com/crm/f/117/t/242982 , especially what Shivaram Santosh wrote:
If you are creating multiple plugins for same entity, then follow these 3.
1) First differentiate Plugins to Async and Sync (Based on need of result),
2) Still you have multiple Synchronous Plugins then set execution order.
3) After that sometimes you might get infinite loop error because of these multiple plugins. If you face this kind of error, then use Context.Depth for prevent this kind of errors.
I have both plugins registered on the Post-Update-Event, one is synchronous, one asynchronous - so there shouldn't be a problem I thought. In my code I have the following lines:
base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(40, "Update", "invoice", new Action<LocalPluginContext>(GenerateInvoiceNumber)));
base.RegisteredEvents.Add(new Tuple<int, string, string, Action<LocalPluginContext>>(40, "Update", "invoice", new Action<LocalPluginContext>(UpdateVATInDetails)));
And whatever I tried until now - only the first plugin registered here in code is executed - if I swap the lines, the other one is executed. I also set both Plugins to synchronous and set the execution order - no success.
Thanks in advance
Kathrin