0

Here is my rule - it fires when I try to move to > 75% probability on an Opportunity NOT owned by me. It does NOT fire in my sandbox.

AND(
Owner.Id = LastModifiedBy.Id ,
ISCHANGED(Probability),
Probability > 75/100
)
2
  • 6
    not owned by me should be $User.Id <> OwnerId
    – cropredy
    Commented Apr 30 at 16:19
  • 1
    Validation rules run before the record is saved. Since you haven't saved (modified) the record yet, you are not yet the LastModifiedBy user. To check against the current user, you should always use $User. Commented Apr 30 at 17:33

1 Answer 1

1
AND(
        ISCHANGED(Probability),
        Probability > 0.75,
        $User.Id != OwnerId
)
  • ISCHANGED(Probability): This checks if the probability is changed.
  • Probability > 0.75: This checks if the probability is greater than 75%.
  • $User.Id != OwnerId: This checks if the current user's ID is not the same as the Opportunity's owner ID.

When all conditions are true, the validation rule will trigger an error message, preventing the user from saving the record.

Learn more about validation rule: https://help.salesforce.com/s/articleView?id=sf.fields_about_field_validation.htm&type=5

You must log in to answer this question.

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