Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

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

Posted on by 405

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

*This post is locked for comments

  • Suggested answer
    Yadnyesh Kuvalekar Profile Picture
    Yadnyesh Kuvalekar 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
    Kishor Kumar 3,702 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
    Kumar Viju 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
    TNS 1,195 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
    Community Member Microsoft Employee 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans