Event Pipeline, Pre-Images & Post-Images in Dynamics CRM

Event Pipeline: The even pipeline allows you to configure when in the event the plug-in code will execute. There are 3 Event Pipeline stages namely, Pre-Validation, Pre-Operation, and Post-Operation.

Pre-Validation: In the pre-validation stage, security checks are performed to verify whether the calling or logged on user has the valid permissions to perform the intended operation.

Pre-Operation: Plug-in will run after validation and before the values are saved in the database.

Post-Operation: Plug-in will run after the values have been inserted or changed on the database.

Pre-Images & Post-Images?

Entity images are snapshots of CRM records that are stored on database either before the database operation is completed or after the completion of database operation.

Pre-Image:

It is the snapshot of the entities’ attributes data before saving on the database. The following image shows pre-image availability.

Post-Image:

It is the snapshot of the entities’ attributes data after saving on the database. The following image shows post-image availability.

Pre-Image & Post-Image Example:

Whenever a parent account field is updated on the account entity, we want to retrieve the old value of the field and update in pre-value field.

Register a plug-in in account entity and register a step update account name field and select stage as post-operation.

Register an image step on update step. Give some names to pre-image and post-image checkbox Select attribute to display pre and post image values.

Example Code for Pre-Image and Post-Image

Here we update the account name and parent account.

Pre-Image value updated with parent account value and Post-image value of phone field updated with postvalue of parent account field.

Need help in Microsoft Dynamics 365/CRM Plug-in development? Contact salesteam@mtccrm.com.

 

About Apps Now

Apps Now offers latest reads on Microsoft Technologies and Business Applications in an easily understandable and digestible manner for you to drive some mileage out of it. Keep following Apps Now to learn new technologies and best coding practices.

See more blogs from Apps Now

No Comments

Add a Comment

  1. (max length 2000)
  2. captcha refresh captcha
Please Wait