Carry out the following steps to create a validation rule to prevent non-system administrators from changing the name of an account record:
- Click on the Setup gear icon in the top right-hand corner of the main Home page, as shown in the following screenshot:
- Click on Setup, as shown in the following screenshot:
- Navigate to the Account Validations Rule setup page by clicking the following: Objects and Fields | Object Manager | Account | Validation Rules.
Locate the Validation Rules section on the right of the page.
- Click on New.
You will be presented with the Account Validation Rule Edit page.
- Type 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.
- Leave the Active checkbox checked.
- Optionally, enter details in the Description field.
Locate the Error Condition Formula section positioned lower down on the page.
- Paste in, or enter, the following code:
AND( ISCHANGED( Name ), $Profile.Name <> "System Administrator" )
- In the Error Message section, enter the text Only System Administrators are allowed to change the Account Name.
- For the Error Location option, select Field.
You will be presented with the Field selection options list.
- Select the field Account Name.
- Finally, click on Save, as shown in the following screenshot: