-1
IF($User.Id = OwnerId , False, IF($User.Id = A__c , False, IF($Profile.Name = 'An Admin', False, IF($Profile.Name = 'System Administrator, False, True))

Hi, this validation rule says only if A__C which is a lookup to user and Owner of record they can only edit the record except system admin. I need to add one more profile let's say B who can also edit. how it can be amended here?

1

You don't need any of those IF statements.

AND(
    $User.Id != OwnerId,
    $User.Id != A__c,
    $Profile.Name != 'Profile B',
    $Profile.Name != 'An Admin',
    $Profile.Name != 'System Administrator'
)
0

Hi not able to fully get you, still what I understood : if user is not owner Id, and not in look up field, and also not having, one of those profiles(including system admin), then throw an Validation Error

As per that, this should be your validation rule.

 ($User.Id <> OwnerId ) && ($User.Id <> A__c  ) && 
( $Profile.Name <> 'System Administrator || $Profile.Name <> 'New Profile Name')
  • Just to modify a bit, system admin can modify the record except some other profiles and that is why the last line is IF($Profile.Name = 'System Administrator, False, True)), however i understood that && ( $Profile.Name <> 'System Administrator || $Profile.Name <> 'New Profile Name') inclusion of one profile who can also edit apart from system admin. Also, i think && wont work because it is not the valid one? – Saswat Jul 23 '15 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.