2

We have validation rules on lead object and there are few records that were created before the validation rule was defined.

When somebody is trying to change the lead owner from UI, It is firing the validation rule.

Is there any way to prevent the validation rule from firing when somebody is changing the record owner?

There is this salesforce help article (https://help.salesforce.com/apex/HTViewSolution?id=000005079&language=en_US) and it suggests to add the profile/role name of the user but I would like to know if there is a better way to do this than defining the profile names.

1 Answer 1

2

You have a couple of options:

  1. Explicitly list users or profiles (not recommended)
  2. Use a hierarchical custom setting with the validation rule (e.g. http://www.verticalcoder.com/2012/07/26/custom-settings/)
  3. Have the validation check the Created Date/Last Modified Date and not fire for old records

Custom settings (option 2, above) provide the most flexibility as they can disable/enable validation rules by org, by user, or by profile.

1
  • Excellent! Glad I posted here otherwise I thought only option 1 & 2 are available.
    – javanoob
    Commented Sep 9, 2015 at 14:28

You must log in to answer this question.

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