Monday 8 February 2016

Plugin Stages - Pre Validation, Pre Operation and Post Operation

Hi,
 
Here is short description about the stages in Plugin.
 
Pre Validation - Plug-ins registered in this stage may execute outside the database transaction. Registered Plug-in run before the form is validated. It is useful if you want to implement business logic before the actual validation starts.  i.e., Changes made in plug-in won’t be saved if the validation of the main system plugins complain because the changes are outside the database transaction.
 
For example - Deletion cascades happen prior to pre-operation, therefore if you need any information about the child records, the delete plugin must be pre-validation.
 
Pre Operation - Plug-ins registered in this stage are executed within the database transaction. In simple words, After validation and before saving the values in database.
 
Post Operation - Plug-ins registered in this stage are executed within the database transaction. Plugin will run after the values have been inserted/changed on the database

For more information check this Stages, Stages Number and their use in CRM Plugins

--
Happy CRM'ing
Gopinath

No comments:

Post a Comment