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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

What is difference between IPluginExecutionContext ,IPluginExecutionContext2,IPluginExecutionContext3,IPluginExecutionContext4 D365 CRM

(0) ShareShare
ReportReport
Posted on by 20

Please explain difference and use of senario of  IPluginExecutionContext ,IPluginExecutionContext2,IPluginExecutionContext3,IPluginExecutionContext4 D365 CRM.

As I know IPluginExecutionContext we used in plugin that run of CRM. but I don't know others use

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Radhika,

    I think they might be running in a different context. Can you please share some more code details?

    May it is because of the impersonation. For more details: 

    1. https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/impersonation-plugins?view=op-9-1
    2. learn.microsoft.com/.../impersonate-a-user
  • Shaun W Harvey Profile Picture
    242 on at
  • Shaun W Harvey Profile Picture
    242 on at

    I think "3" has an additional "AuthenticatedUserId" property.

    "4" Implements all the previous ones, so you would get access to everything.

    Where and when you would use them I can't say.

  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Hi Radhika,

    the IPluginExecutionContext interface is used to provide information about the current plugin execution context to the plugin code. It provides access to a number of objects and properties that can be used by the plugin to perform its logic. There are multiple versions of this interface, each with slightly different functionality:

    • IPluginExecutionContext: This is the original version of the interface, which provides basic information about the current plugin execution context, such as the input parameters, output parameters, and the target entity.

    • IPluginExecutionContext2: This version of the interface was introduced in Dynamics 365 (CRM) and provides additional functionality over the original version, including the ability to access the related entities, the depth of the plugin execution, and the business process flow stage, if applicable

    • IPluginExecutionContext3: This version of the interface was introduced in Dynamics 365 (CRM) and provides additional functionality over the previous version such as access to the shared variables, the source entity of an operation, the Target Entity and Pre Entity images

    • IPluginExecutionContext4: This version of the interface was introduced in Dynamics 365 (CRM) and provides additional functionality over the previous versions such as access to the execution context mode, the initiating user and its related attributes, access to the child pipeline execution context, and the ability to cancel the execution of the plugin

    As you can see, each version of the IPluginExecutionContext interface provides additional functionality over the previous version. When developing plugins for Dynamics 365 CRM, you can use the version of the interface that best suits the needs of your plugin. As newer version of the interface have been introduced, developers can have

  • Shaun W Harvey Profile Picture
    242 on at

    Is there a link in the documentation somewhere as to these changes and when they occurred?

    Just curious, as properties such as plugin depth, shared variables and pre/post entity images have been in the original IPluginExecutionContext interface since at least the CRM2011/2013 days from what I can remember.

  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Hi Shaun,

    You can take a look at this documentation:

    learn.microsoft.com/.../microsoft.xrm.sdk.ipluginexecutioncontext

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 75 Super User 2026 Season 2

#2
Travis South Profile Picture

Travis South 43

#3
Syed Aqib Raza Profile Picture

Syed Aqib Raza 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans