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
HowAboutThatHowAboutThat 

Validation Rule Problems!

It's probably something stupid, simple validation rule that states only users with system admin profile can edit the field.  It doesn't work though and can't see what i'm doing wrong
 
Code:
AND(
   ISCHANGED( Basic_Price__c ),
      $Profile.Name <> "System Administrator"
)

 
Any suggestions would be greatly Appreciated
KaushikKaushik

Hi

Instead of using Profile.Name try using the $User.ProfileId 

This is the profile Id of the user who has logged in.

Then you can use the ProfileID of the System Administrator instead

Hope this helps you out

HowAboutThatHowAboutThat
Thanks for that, I'll let you know how i get on.
LukdanLukdan
I had the same problem with  $Profile.name not working. I also tried $Profile.description...also no good.  Ultimately, I tried user last name and it worked fine.