Thursday, July 8, 2021

When can infinite loop occurs in plugin? How do you avoid infinite loops in plugin code?

 The CRM platform throws an error stating that it has identified an infinite loop. This usually happens after the number of iterations reaches a maximum of 8. We can fix this by adding a depth check at the start of our plugin code, just after we initialize each of the service objects.

The common method to avoid a recurring plugin is to check if  a plugins depth > 1.  This would stop the plugin from being run if was triggered from any other plugin.  The plugin would only run if triggered from the CRM form.

No comments:

Post a Comment

Featured Post

Construction Result Summary Jun-2019