+ Start a Discussion
lonely boylonely boy 

I need a Validation rule 'If a case is createdBy 'System Admin' then only system admin can edit that record others shouldn't edit it.

AbhinavAbhinav (Salesforce Developers) 
Hi 

I think below validation will work for you
If a user is sysadmin than he can edit every record( created bt sysadmin or other) if not that he can only edit those record of which he is owner.
AND 
( 
 NOT(ISNEW()), 
 OR( 
       $Profile.Name <>'System Administrator', 
       $User.Id <> OwnerId 
      ) 
)
Reference :
https://developer.salesforce.com/forums/?id=9060G0000005Wi6QAE

If it helps mark it as best answer.

Thanks
 
mukesh guptamukesh gupta
Hi,

Please use below validation:-
CreatedBy.Profile.Name == 'System Administrator'  &&  $Profile.Name != 'System Administrator' && NOT(ISNEW())



if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh
ravi soniravi soni
hi lonely,
try below rule.
AND( NOT(ISNEW()),
CreatedBy.Profile.Name = 'System Administrator',
Owner:User.Profile.Name <> 'System Administrator'
)

it will help you. don't forget to mark it as best answer.
Thank you
ravi soniravi soni
hi lonely,
did you try my solution. I am sure it will help you.
don't forget to mark it as best answer.
your one best mark give us motivation to working in this direction.
thank you