1

I have a transaction in CRM and it is reaching its maximum depth (8), it is a very complex chain of plug-ins and the business requires this operation in this way.

Is it a good option to change the maximum depth from (8) to (16) because our business requires or there is something that we should not do because there is a lot of logic being reached.

I asking this because Microsoft says this restriction is to detect infinite loops.

I want to ask Microsoft this, but this person that Microsoft has for us has a conflict of interest, because they want the same client we have, so if we suggest this for our CRM they will want to see what is wrong instead on focusing for the best solution for us.

Thanks in advance, I really appreciate your time.

Sxntk
  • 845
  • 14
  • 29
  • 1
    change your plugin logic to don't reach the maximum depth (8 is already an high value) if you say that the business requires in that way, probably a plugin is not the best way where you are putting all your logic – Guido Preite Nov 09 '16 at 22:20
  • There are like 10 plug-ins; example: A user from contoso closes a lead, lead validates its state, change of the state closes a related activity to the lead, the close of the activity creates a sales order... and every of these steps has a plug-in so the last one reach the maximum depth. – Sxntk Nov 09 '16 at 22:30
  • 2
    I repeat, if your logic is so complex and you are reaching the maximum depth, the plugin (that as you described are all synchronous) are not the right place to put your code – Guido Preite Nov 09 '16 at 22:35
  • Thanks, we will discuss this and we are open to other alternatives. – Sxntk Nov 09 '16 at 22:43
  • I its hitting the maximum depth then the best approach will be to redesign the functionality and move out some or all of the functionality to a service! It depends on the functionality + other parameters, may be the combination of plugin + workflow + service will work for you. – Yaqub Ahmad Nov 10 '16 at 06:15
  • I would suggest @GuidoPreite 's comment. Try to redesign your processes. Maybe you could merge those multiple plugins into a workflow or other processes. – Jordi Nov 10 '16 at 08:33
  • If there is not other option we will try to redesign the process. Post it as an answer. – Sxntk Nov 10 '16 at 13:55

1 Answers1

0

We decide to group the plug-ins by entity and message.

So if we had one plug-in foo filtering new_field1 and another plug-in doing bar filtering new_field2 we merged both plug-ins in one.

One step was registered filtering both fields and the implementation handles when to call foo, bar or both.

This way we reduce the depth.

Sxntk
  • 845
  • 14
  • 29