plugin registered on post entity image, how is it different from context information ?
*This post is locked for comments
Hi,
I have explained below with an example:
Lets assume you have an update post operation plugin on an account entity. Now when an account is updated, you want to create a new record in custom entity and put account nember in the custom entity record. So now if you use either plugin context or post entity image to fetch account number, then it will work as per below:
1. If account number field is updated, it will be available in plugin context and no error will occur.
2. If account number field is not updated, it will not be available in plugin context and hence it will throw an error saying account number field not found.
3. Irrespective of whether account number field is updated, this field will always be available in post image.
So, if you want any information from same record and not available in context record, then we use entity images.
Hi bhuvaneswary rajasekaran,
Check the below links,
msdn.microsoft.com/.../gg309673.aspx
community.dynamics.com/.../pre-image-38-post-image-explained-33
Hi,
Plugin Context Information: Is where all the contextual information is brought to your code. InputParameters and OutputParameters member contain for example the record the plugin is being fired upon, the pre- and post-image, the handled message (The actual data depends on how you registered the plugin: pre VS post, the exact message, online or offline...)
Pre and Post Image: Contain snapshots of the primary entity's attributes before (pre) and after (post) the core platform operation. Microsoft Dynamics CRM populates the pre-entity and post-entity images based on the security privileges of the impersonated system user. Only entity attributes that are set to a value or are null are available in the pre or post entity images. You can specify to have the platform populate these PreEntityImages and PostEntityImages properties when you register your plug-in. The entity alias value you specify during plug-in registration is used as the key into the image collection in your plug-in code.
**Registering for pre or post images to access entity attribute values results in improved plug-in performance as compared to obtaining entity attributes in plug-in code through RetrieveRequest or RetrieveMultipleRequest requests.
Ex: If you are writing a update plugin on opportunity and would like to get the details of other attributes which were not passed by your context and you want to retrieve these values after performing Update operation , then you can make use of Post - Image.
Ref:
msdn.microsoft.com/.../gg309673.aspx
stackoverflow.com/.../what-is-context-servicefactory-and-service-in-plugin-crm-2011)
Hi,
Context contains the run-time information of the plugin when it is executed,and if your plugin contains the post entity image, it will also be contained by context.
refer below links for better understanding :
community.dynamics.com/.../pre-image-38-post-image-explained-33
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156