web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

how to invoke multiple plugins on a single entity.

(0) ShareShare
ReportReport
Posted on by 6

I have a requirement where i want to create multiple plugins for a single entity ,

but i want no plugin should create a trouble while executing the other.

how can i implement this functionality.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    joman Profile Picture
    617 on at

    plug-in function:

    try

    {

    // your code

    }

    catch {}

    Will execute without any troubles.

  • EmployeeOcta Profile Picture
    6 on at

    what if i am writing more than one plugin on create and update message on the same entity.

  • Suggested answer
    joman Profile Picture
    617 on at

    They will all file at event, you will register them.

    More about Event execution pipeline: https://msdn.microsoft.com/en-us/library/gg327941.aspx

  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    You will need to use the Execution Order property during plugin step registration.

    As described below you can even configure it with this tool later:

    community.dynamics.com/.../new-xrmtoolbox-plugin-synchronous-events-execution-order-Editor

    You also need to look out for the Depth variable of your execution context. You might fire one of plugins multiple times depending on what updates or actions you do in your plugin.

    More here:

    crmbusiness.wordpress.com/.../stopping-infinite-plugins-with-parameters-depth-and-parentcontext

  • Suggested answer
    joman Profile Picture
    617 on at

    [quote user="Andreas Cieslik"]You also need to look out for the Depth variable of your execution context[/quote]

    But here you need to know one think:

    https://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.iexecutioncontext.depth.aspx

    The maximum depth (8) and time limit (one hour) are configurable by the Microsoft Dynamics 365 administrator using the PowerShell command Set-CrmSetting. The setting is WorkflowSettings.MaxDepth. For more information, see, “Administer the deployment using Windows PowerShell” in the Deploying and administering Microsoft Dynamics CRM.

  • Suggested answer
    shivaram Profile Picture
    3,315 on at

    Hi,

    I know this is 10 days old, even I want you to suggest for this,

    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.

    Hope it helps you.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans