Introduction In Dynamics 365, plugins automate business processes, enforce rules, and ensure data integrity. Whether in Sales or Customer Service , plugins help streamline workflows by executing logic at the right time in the pipeline. This post covers key plugin scenarios , detailing: ✅ Execution pipeline stage (Pre-Validation, Pre-Operation, Post-Operation) ✅ Synchronous or Asynchronous execution ✅ Pre-Image / Post-Image usage ✅ Rollback handling Rollback Handling in Plugins When Does a Plugin Rollback? A plugin automatically rolls back if: An exception is thrown in a synchronous plugin. A transaction fails in a Pre-Validation or Pre-Operation stage. How to Handle Rollbacks? Use Try-Catch Blocks : Prevent unwanted failures by catching errors and logging details. Throw an Exception When Needed : Stop invalid data changes (e.g., prevent closing an Opportunity without a Quote). Compensating Logic in Async Plugins : Since Post-Operation Async plugins do not par...
Collections : Collections are special types of variables or data storage mechanism which can be used to manipulate the data within Power Apps. Collections are usually a group of similar items which acts like a table of values with columns and rows. We can create, update, delete, use it as the data source for a gallery to view the items within Power App. Collect, Clear, and ClearCollect functions: Collect : In Power Apps, the Collect function is used to create or update a collection in your app. Collections are temporary data sources that allow you to store and work with data within your app. The Collect function is versatile and can be used in various scenarios to add, modify, or remove records from a collection. Syntax : Collect( IceCream, { Flavor: "Pistachio", Quantity: 40 }, { Flavor: "Orange", Quantity: 200 } ) Adds two records to the IceCream collection that includes a quantity of pistachio and orange ice cream. Clear : In Po...