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
BA_AdminBA_Admin 

Help on Validation Rule

Hi Guys i have a validation rule on Account

AND(
ISCHANGED( Name ),
 $Profile.Name  <>  "system administrator"
)

 

Iam a system Admin and i created a new account, and when i tried to edit the Name, it's throwing up the error,actually according to this validation rule, ISCHANGED( Name ) is true and $Profile.Name  <>  "system administrator is false, so result would be false since there is AND operation, so the validation rule should not be fired, but i don't knw why it's getting fired for me being as system Admin.

 

Any help guyss.....................................

Best Answer chosen by Admin (Salesforce Developers) 
Always ThinkinAlways Thinkin

Have you activated the System Log and checked out what is actually happening under the hood? You could filter out everything by the Validation behavior to make finding it easier. If the answer doesnt immediately jump out at you, post the logs back here and we'll all take a look.

 

Luke C

All Answers

Always ThinkinAlways Thinkin

Hi,

Sure looks like it should work as written but rather than waste time troubleshooting, could you use $User.ProfileId instead?

 

Luke C

BA_AdminBA_Admin

Even it's not working by keeping $User.ProfileId...............

Pradeep_NavatarPradeep_Navatar

Try the sample given below :

 

AND(

ISCHANGED(Name),

$Profile.Name = "System Administrator"

)

 

Hope this helps.

BA_AdminBA_Admin

Yes According to your rule it works , but my question is

ISCHANGED(Name) is true

$Profile.Name = "System Administrator" is true

 

so true and true is true, so the validation rule should get fired ryte, but it is not firing.

Always ThinkinAlways Thinkin

Have you activated the System Log and checked out what is actually happening under the hood? You could filter out everything by the Validation behavior to make finding it easier. If the answer doesnt immediately jump out at you, post the logs back here and we'll all take a look.

 

Luke C

This was selected as the best answer