I find it very helpful to provide a method to turn off/on validation and workflow rules on a per user or per profile basis. Advantages:
- Data migrations and manipulation. I was loading contact data split into two files (1st for name, 2nd for contact details), while a validation rule prevents creating a contact without a phone or email address.
- Integration. Often times integration should not be subjected to the same rules as a typical user. You could hard code the integration user details into each validation rule, but that isnâ€™t very extensible.
- Flexibility. Youâ€™ve got it.
There are two basic ways to accomplish this:
1. Add exception fields to a custom setting. There are some complexities with this method but it is my favorite (make sure to set org wide defaults!).
2. Add exception fields to the user record.
Hereâ€™s a brief overview of the pros/cons of each:
|Custom Settings||User Record|
|Per profile & per user.||Per user only.|
|Must be manually migrated to new sandboxes (except for full sandboxes).||Carries over on user record when sandbox created.|
|Workflow rule conditions must be written as â€œwhen formula evaluates to trueâ€.||Workflow rule conditions can be constructed as normal.|