Thursday, February 6, 2020

How to restrict the record edit access using validation rule in salesforce

Assume once the account record is created other users can edit the record except for system administrator and record owner.

Validation Rule
AND( 
    NOT(ISNEW()),
    NOT(OR($Profile.Name == 'System Administrator', $User.Id == OwnerId))
)

above validation rule throws an error if any other user tries to edit the record.

1 comment:

  1. Error: Field OwnerId does not exist. Check spelling.

    ReplyDelete