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
Dastagiri BashaDastagiri Basha 

Hi All, i have a requirement on cpntact object, If the Lead source is in "Web" or "Other" no one should change the Lead Source Field to any value except Admin & Dev profiles and we have to through an Validation.

I have written an validation rule but it's not working can any one help me.
AND(ISCHANGED(LeadSource), OR(ISPICKVAL(PRIORVALUE(LeadSource),'Web'),
ISPICKVAL(PRIORVALUE(LeadSource),'Other' ) ),NOT(
$Profile.Id = '%2F00e5g000002NiSg'))
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Dastagiri,

Can you try something like below. Please include the name instead of ID and rest all looks good.
 
AND(ISCHANGED(LeadSource), OR(ISPICKVAL(PRIORVALUE(LeadSource),'Web'),
ISPICKVAL(PRIORVALUE(LeadSource),'Other' ) ), $Profile.Name !='System Administrator' )

if this solution helps, Please mark it as best answer.

Thanks,
 
CharuDuttCharuDutt
Hii Dastagiri
Try Below Validation
AND(ISCHANGED(LeadSource), OR(ISPICKVAL(PRIORVALUE(LeadSource),'Web'),
ISPICKVAL(PRIORVALUE(LeadSource),'Other' ) ), $Profile.Name <> 'System Administrator' )
Please Mark It As Best Asnwer If It Helps
Thank You!