Friday, July 8, 2016

Using Custom Settings to Control Validation Rules and Workflows

As you customize your Salesforce Org you will undoubtedly create many Validation Rules and Workflows.
These are the bread and butter tools of a Button-Click Admin (a term used to describe an Administrator that can develop new functionality on the Salesforce Platform without writing one line of code). 

While very powerful, there are some scenarios where you may want to have more granular control over how and when they work. For example:

  • Create a Validation Rule or Workflow that only applies to some users or profiles (instead of hard-coding profile names into the rule itself)
  • Have the ability to turn on/off many Validation Rules/Workflows centrally
  • Turn off Validation Rules that interfere with Code Deployment, but only for the user that is performing the deployment
  • Create 'Sets' or 'Groupings' of Validation Rules that can be turned on/off centrally
There are many other scenarios and the technique that I am about to share with you can be adapted to many other cases.

Though I only explain here how to utilize this technique for Workflows and Validations, it can easily be adapted to control Triggers as well - and in fact I use this extensively in my Orgs.

One Caveat: as of the time of this writing, this method CANNOT be used with Process Builder, since Custom Settings values are not accessible in this tool yet.




Below is a slideshow I had the pleasure of presenting in a Salesforce CloudForce event in New York City.
It includes more details and step-by-step instructions on how to implement and test this technique.


No comments :

Post a Comment