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)

What is the purpose of post image in ms crm plugin ?

(0) ShareShare
ReportReport
Posted on by 405

plugin registered on post entity image, how is it different from context information ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Yadnyesh Kuvalekar Profile Picture
    4,102 on at
    RE: What is the purpose of post image in ms crm plugin ?

    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.

  • Suggested answer
    Kishor Kumar Profile Picture
    3,710 on at
    RE: What is the purpose of post image in ms crm plugin ?

    Hi bhuvaneswary rajasekaran,

    Check the below links,

    msdn.microsoft.com/.../gg309673.aspx

    community.dynamics.com/.../pre-image-38-post-image-explained-33

    crmbook.powerobjects.com/.../plug-in-images-pre-vs-post

  • Suggested answer
    Kumar Viju Profile Picture
    1,026 on at
    RE: What is the purpose of post image in ms crm plugin ?

    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)

  • Suggested answer
    TNS Profile Picture
    1,197 on at
    RE: What is the purpose of post image in ms crm plugin ?

    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.

  • Suggested answer
    Community Member Profile Picture
    on at
    RE: What is the purpose of post image in ms crm plugin ?

    refer below links for better understanding :

    community.dynamics.com/.../pre-image-38-post-image-explained-33

    crmbook.powerobjects.com/.../plug-in-images-pre-vs-post

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans