Difference between Context and Pre-Image in plugin?
*This post is locked for comments
I have the same question (0)

Difference between Context and Pre-Image in plugin?
*This post is locked for comments
I have the same question (0)Hi Rohni,
Context means Current.
Context contains the entity business information which is being updated currently on CRM Platform.
In Plugin,
IPluginExecutionContext contains information that describes the run-time environment that the plug-in executes, information related to the execution pipeline, and entity business information.
When a system event is fired that a plug-in is registered for, the system creates and populates the context and passes it to a plug-in through the previously mentioned classes and methods. The execution context is passed to each registered plug-in in the pipeline when they are executed.
Context Example -
Let say. I have a plugin registered on Update of Contact Entity, If I update only Firstname and Lastname of contact record then plugin code can get only Firstname and Lastname field's value from the Plugin Context along with the information related to the execution pipeline.
But If I want to get the other field's value like emailaddress and account name from plugin context, we will not be able to get the same and will get the error 'The given key was not present in the dictionary' error.
To get these values, either we will have to perform retrieve query or can achieve it through pre-images.
So Images are the best ways to get the copy of data (from whatever fields you want) before and after changes made to the database or changes committed to the database. While from context we can get the updated field's values only
Follow my below article for the same - http://arpitmscrmhunt.blogspot.in/2018/01/pre-image-and-post-image-in-dynamics-crm.html
If found useful, please mark the answer as verified.
Cheers
Arpit
https://arpitmscrmhunt.blogspot.com