Often there is a need to restrict the updating of data from users within Salesforce CRM. A typical example is where account records are created according to an agreed process or naming convention, which requires verification by other users or systems within the organization.
In this recipe, we will construct a validation rule that prevents the changing of account name by users who are not logged in as system administrators.
Carry out the following steps to create a validation rule:
Admins Only to Update Name
in the Field Label textbox (upon clicking out of the textbox, the name changes to Admins_Only_to_Update_Name).This validation rule is for stopping non-System Administrators from changing Account Names
.AND( ISCHANGED( Name ), $Profile.Name <> "System Administrator" )
Only System Administrators are allowed to change the Account Name
.Having logged in as a user that does not have a system administrator profile and changing the name of an account record, the validation rule is activated and the record is prevented from being saved. Upon the attempt to save, an error message is displayed below the Account Name field stating Error: Only System Administrators are allowed to change the Account Name.
You can see what this looks like in the following screenshot:
18.223.171.51