Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Post image

(0) ShareShare
ReportReport
Posted on by 5,464

I have been asked in interview

I said in an interview

Pre image is used to check before value and Post image is used to check after value . I have been asked  if system is having the value why post image is required ?

Why actually we need post image

*This post is locked for comments

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Post image

    Just to add on " if system is having the value why post image is required " if you do not use post image then you need to do a retrieve to get the system value by doing another call which is not a good practice considering you can get the system value in post image.

    Hope this helps.

  • Verified answer
    Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: Post image

    You have a plugin that execute on "Name" field of account entity but some one updated name and post code then you will not get value of post code in target as your plugin execute for name only. In this case you need post image. Post image will have post code.

  • Suggested answer
    Kalpavruksh D365 CoE Profile Picture
    2,545 on at
    RE: Post image

    Hi,

    Current Context will contain the fields that are changed by the user. Use PostImage to retrieve additional fields apart from the context fields(updated). 

    Example:  User updated account name but you need information from the owner field. 

    Current Context: Name

    PostImage: Owner

    Please let us know, in case of any further query.

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: Post image

    Hi

    Plugins allows us to write custom code to implement custom business logic, this could be just validation, or changing data or any type of operation really.

    Now, plugin only triggers on Events (Messages), for example update or delete or create or other

    If a Plugin triggers lets say on Update of a field, and lets assume in your plugin code you want to check what was the previous value and whats the new value.

    You can only get to the previous value in plugin by asking CRM to give you a copy of the record just before the change was made - This is PreImage

    You also want to know whats the new value, for this you are getting the Post Image - The post image is copy of the record after the change but it is not yet fully committed to database. if the plugin fails for some reason, any change in the post image will be lost.

    In short, Pre and Post images are just copies of data before change and data after the change. And Post image will only become permanent if the plugin execution completed with no error. If there was an exception in plugin execution, the entire transaction will be rolled back.

  • Verified answer
    Pawar Pravin  Profile Picture
    5,237 on at
    RE: Post image

    Hi Sandeep,

    Let me explain one scenario here.

    Suppose my plugin is on post update of account record (Email address is update and trigger point for the plugin). Now I want to check previous email as well as new email and need to send email to both email Id's.

    Pre-Image will give me previous email Id and Post-Image will give me new email Id.

    Some my concern is with email id want some information from account which is I'm updating inside coding. Let say I'm updating Contact number inside coding. In this case I need to post image to get rest of the values which is updated in account.

    Please refer following blog for more reference:

    community.dynamics.com/.../pre-image-and-post-image-in-dynamics-crm

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans