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
pooja chauchanpooja chauchan 

restriction for user access by validation

HI Folks,

I have a scenario i.e, Whoever is created the record but that record users manager & system admin only edit the record based on Grade field. For this i implemented a validation, but its not working properly. So please suggest me.

OR(ISCHANGED( Grade_1__c ), ISCHANGED( Grade_2__c ), ISCHANGED( Grade_3__c )),
OR( $User.Id=$User.ManagerId )

Highly appreciated!!
Best Answer chosen by pooja chauchan
Gaurav NirwalGaurav Nirwal

You can use below updated formula:
IF(OR(ISCHANGED( QnxSPM__End_Date__c ) ,ISCHANGED( QnxSPM__Start_Date__c )),IF(AND($User.Id <>Owner.ManagerId, $User.ProfileId <> 'SystemAdministratorProfileID'), true,false),false)Replace SystemAdministratorProfileID with Appropriate ID of System Admin Profile.

If this solves your problem, kindly mark it as the best answer.