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
Connor CainConnor Cain 

Validation Rule for Number field changes not Working right

I am creating a Validation rule that a field cant be changed once a date is pasted unless you are a system admin, this all works except the ISCHANGED() section which wont work. Any help would be appreciated.
members__c is a number field and Start_Date__c is a date field.

AND(
$Profile.Name <> 'System Administrator',
ISCHANGED(Members__c),
Start_Date__c <= TODAY()
)
VinayVinay (Salesforce Developers) 
Hi Connor,

Can you re-check the above validation should work or do you want to have OR condition with Member field and start date?

Thanks,
Vinay Kumar
Connor CainConnor Cain
hey Vinay,
Unfortunately it still doesnt work, I even switched it to be "$Profile.Name = 'System Administrator'" to test it as myself and that didnt work. we need it to be an AND condition since all of the conditions need to be met in order to stop users from editting the field after the start date.
Connor CainConnor Cain
just copied and pasted it into a new (spring '20) sandbox and it worked. i was currently working in a Summer '20 sandbox.
VinayVinay (Salesforce Developers) 
Hi Connor,

I tried above code earlier and it is working as expected.

Is this not working in summer'20 org? 

Hope it should work in other org as well.

Thanks,
Vinay Kumar 
Swiderski, ErikSwiderski, Erik
I've never had good luck using profile names in validation rules. Just my personal experience. Try replacing  
$Profile.Name <> 'System Administrator',
with
$Profile.Id <> '00eXXXXXXXXXXXX',
obviously, replace the profile id in my example with your org's profile id for System Administrator.