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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Shared variables in Dynamics 365 Customer Engagement (CRM) Plugins

(1) ShareShare
ReportReport
Posted on by

In continuation of advanced plugin concepts part 1, in this post, we’ll discuss shared variables in ms CRM plugins and how to use them. We’ll also discuss user impersonation in plugins and how we can use it.

Also read: What is Microsoft Dynamics 365?

1. Shared Variables

Microsoft Dynamics 365 Customer Engagement platform and the execution pipeline provides the ability to pass data from one plug-in to another through an IPluginExecutionContext property called SharedVariables. This property is a collection of key/value pairs which developers can use to share data between plug-ins which are registered on both the pre and post events.

Shared Variables are useful for sharing the data during complex Plug-in development by sharing the data between Plugins registered on both the pre and post events.

Any value stored in the Plug-in context of Pre-event will be available in the Post-event of the Plug-in. This way, we can avoid storing the values in a custom attribute. Certain data validation which needs to be done at post-event can be achieved by passing the value from Pre-event of the Plug-in.

 

Also Read: Impersonation in Dynamics 365 Plugins

 

Test Case: For a demo, let’s say We want to check if the contact being created is duplicate i.e. contact exists with same first name and last name in Customer Engagement. If it exists, on post-operation, we want to mark the contact status duplicate. [Read More]

*This post is locked for comments

I have the same question (0)

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

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans