Plugins in Dynamics CRM, allow you to register images against the steps of a plugin assembly. Images are a way to pass the image of the record that is currently being worked upon prior or after the action has been performed. In general it could be said, it is the image of the record as is available in the SQL backend.
Two types of Images are supported, Pre-Image and Post Image.
In case of Pre-image, you get the image of the record as is stored in the SQL database before the CRM Platform action has been performed.
Post Image, returns the image of the record after the CRM Platform action has been performed.
It is there important to understand when the images would be available and what state of the record would be returned in these images.
Say you were to register a “Pre-Image” for a plugin registered in Pre-Create Stage. We just mentioned above, that the image is a copy of the record as is stored in the SQL backend. Since this is the create stage and the record has not even been created as yet, there is no record in the SQL backend that can be returned in the Pre-Image and hence any call for the image would fail with the above error message.
The following table explains the Pre-Image Availability:
Stage | Create | Update | Delete |
PRE | NO | Yes | Yes |
Post | Yes | Yes | Yes |
The following table explains the Post-Image Availability:
Stage | Create | Update | Delete |
Pre | No | No | No |
Post | Yes | Yes | No |