function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mayara miranda 5mayara miranda 5 

validation rule helpppppp

I want to create a validation rule for:

the user can only edit the name field in the contact object if the contact has the status "approved"
Maharajan CMaharajan C
Hi Mayara,

Please try the below Validation Rule:

Use your correct Status field api name in below i havee assumed as status__c :
 
AND(
	NOT(ISNEW()),
	OR(
        ISCHANGED( FirstName ),
        ISCHANGED( LastName ),
        ISCHANGED( Salutation )
        ),
	TEXT(Status__c) <> 'approved'
)

If you don't want the Salutation in above rule you can remove it.

Thansk,
Maharajan.C
Maharajan CMaharajan C
Without Salutation :
 
AND(
	NOT(ISNEW()),
	OR(
        ISCHANGED( FirstName ),
        ISCHANGED( LastName )
        ),
	TEXT(Status__c) <> 'approved'
)

Thanks,
Maharajan.C