You need to sign in to do that
Don't have an account?
swain 10
validation for restriction of field edit for particular profile and user
I have written one validation that some particular fields can only be edited by system admin or user should be record owner or User should be steve.
Please review It.
AND( OR(ISCHANGED( BusinessStrategy__c ),ISCHANGED( BusinessStrategyComments__c )), OR( $Profile.Name <> 'System Administrator' && $User.Id <> OwnerId && $User.Id <> '005U0000001NqquIAC' ))
005U0000001NqquIAC is the user Id of steve because when I am giving $User.UserName='Steve' its throwing validation error even after using User Id still that user not able to edit.
Please review It.
AND( OR(ISCHANGED( BusinessStrategy__c ),ISCHANGED( BusinessStrategyComments__c )), OR( $Profile.Name <> 'System Administrator' && $User.Id <> OwnerId && $User.Id <> '005U0000001NqquIAC' ))
005U0000001NqquIAC is the user Id of steve because when I am giving $User.UserName='Steve' its throwing validation error even after using User Id still that user not able to edit.
AND( OR(ISCHANGED( BusinessStrategy__c ),ISCHANGED( BusinessStrategyComments__c )), OR( $Profile.Name <> 'System Administrator',$User.Id <> OwnerId,$User.Id <> '005U0000001NqquIAC' ))
Please let me know if it works for you.
Regards,
Pawan Kumar
Hi Swain 10
Here is Sample of Validate Rule that fullfill your condition. Here I am checking Birthday field on contact object . If its change by user that is not a admin or owner of contact record then it will throw error.
OR((AND(ISCHANGED(Birthdate ), Owner.Profile.Name != $Profile.Name)),(AND(ISCHANGED(Birthdate), $Profile.Name != 'System Administrator')) )
please test and let me know
Regards
Sanjay Bhati
Regards,
Pawan Kumar