Pre-Validation stage plugin example

Problem:

You need to do duplicate detection for records created only by users of a particular team. Out of box CRM duplicate detection rule does not allow to filter the records for validation. It is applicable to all records of a particular entity by default. Therefore it requires additional custom logic to be written and of course you dont want any of your: Pre Operation/ Post Operation plugins to be triggered before this validation.

Solution:

Register the plugin on Pre Validation stage. Therefore this validation is the first thing triggered when you save the record even before the record is submitted to database for create.

Note:

Any validation custom logics need to be ideally registered on Pre Validation Stage. Pre validation plugin runs before any security checks. i.e. even before the CRM check the users security roles to perform the action.

 

Leave a Reply

Your email address will not be published. Required fields are marked *