We have some scenario where we need to skip validation and workflow rule to specific profiles.Since these set of profiles may change frequently (SYSADMIN can add/remove profile names to skip). To achieve this i have two options 1) Hierarchy custom setting 2) Custom permission

Out of this which one is the best approach ?

  • What do you mean by custom permission? How would you use that?
    – human
    Commented Nov 15, 2016 at 10:30

2 Answers 2


Use Custom Setting it is the good solution. Create a flag in Custom Settings and then update the reference of that flag in your apex-trigger code.

So all you would do is create a new Hierarchical Custom Setting. Then for each trigger create a flag and perhaps a flag to disable all triggers.

Using the flag from custom setting add the if condition in apex-trigger code and run the trigger based on the flag.

  • i have modified the questions. Here we need to skip some logic NOT inactivating the trigger. Commented Nov 15, 2016 at 10:02
  • I think custom setting should work for skipping the logic as well based on the flag if you don't want to execute just put the if condition and it would work.
    – RCS
    Commented Nov 15, 2016 at 10:05
  • My question is which is the best approach based on any limitation/drawback ? Commented Nov 15, 2016 at 10:10

Use Custom Permissions instead of Custom Settings

Custom Settings having drawbacks... e.g. Custom Settings are data, they are not populated in unit tests unless the test specifically populates them


  • I think this got flagged and closed because it doesn't necessarily address the question directly, or provide enough relevant detail. Link-only (or mostly link only) answers do get removed by the community pretty quickly. I've undeleted for now, so please do edit and add some more information if you can, otherwise it'll like just attract more down votes and/or be closed again.
    – Matt Lacey
    Commented Dec 19, 2019 at 1:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .