CRM 2011 Plugins – Obtaining Organization Information

Developers can use the IPluginExecutionContext service object to obtain contextual information from the CRM platform which is passed to the plugin at run-time. It includes details about the user who triggered the plugin event as well as transactional information handled at the platform layer. In this post, we will see which properties are available to obtain information about an organization.

The IPluginExecutionContext object includes the following GUID properties:

  • OrganizationId
  • OrganizationName

The OrganizationId property returns the GUID for the CRM organization that the plugin is currently registered against. This property is useful in situations where you have a custom integration with a third-party application where you might be synchronizing data back and forth. The OrganizationId property can help distinguish between different CRM systems if the third-party application is to be integrated with multiple CRM organizations

The OrganizationName property returns the name of your CRM organization. The name returned matches the name which is specified under Developer Resources in the Customizations area.

capture

 

There are many more useful properties available via the IPluginExecutionContext. In my next post, we will take a look at how we can obtain information about the entity record from where a plugin was executed.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s