| Ijlal Monawwar
Event Framework and Execution Pipeline
The Event Framework provides the capability to register custom code to be run in response to specific events. When any event is raised in CRM system, Server generates Organization web service request message which is then passed to series of stages. Pre-Validation, Pre-Operation and Post-Operation.
Pre-Validation: We include logic to cancel the operation on this stage before the database transaction like throwing exceptions on form validation before the transaction is executed, so that there are no rollbacks of the transaction and performance drawbacks. Not hindered by insufficient permissions.
Pre-Operation: Occurs within the transaction and rollback operation is supported. So, if we for example have a plugin that deletes related records and it is triggered on the parent record deletion, but if there is an issue in deleting one of the related records due to insufficient permissions, then the parent record will also be not deleted, and the operation will be rolled back.
Main Operation: Reserved for core operation
Post-Operation: We can use this stage after the operation occurs like for example when a record is created, and we must update it or assign it after creation which is the main operation, we can use the response to get the created record’s id and then update it in post operation stage.
Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.