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
sangam Bp 39sangam Bp 39 

Validation Rule Guys please tell me how to solve this.

My Requirement is I dont want to change lead souce once i entered lead source for this validation is working

AND(ISCHANGED( LeadSource ),TEXT(LeadSource) <> NULL)

 but When I choose the lead source from Blank value to Some lead source Then also it is showing message.

 
Best Answer chosen by sangam Bp 39
SandhyaSandhya (Salesforce Developers) 
Hi Sangam,

I came up with same solution what Prathibha said.

It works.
 
AND(ISCHANGED( LeadSource ),PRIORVALUE(LeadSource) <>NULL)
Thanks and Regards
Sandhya

 

All Answers

SandhyaSandhya (Salesforce Developers) 
Hi Sangam,

Please use below one.
AND(ISCHANGED( LeadSource ),(ISPICKVAL( LeadSource,"") || TEXT(LeadSource) <> NULL))

Hope this helps you!

Please accept my solution as Best Answer if my reply was helpful. It will make it available for other as the proper solution. If you felt I went above and beyond, you can give me kudos.
 
Thanks and Regards
Sandhya

 
sangam Bp 39sangam Bp 39
sandya see this image without lead source also  record is saved
sangam Bp 39sangam Bp 39
After i am changing Lead source from blank value to web then it s showing error.
sangam Bp 39sangam Bp 39
sandya i hope now u are understand my problem
Prathibha SPrathibha S
Hello,

Use this formula :
AND(ISCHANGED( LeadSource__c), PRIORVALUE(LeadSource__c) <> NULL)
I am using PRIORVALUE() since LeadSource should be updated only from empty to Some Value. Once provided should not allow changes. I think this should work for all the use cases.

Please mark this answer as best one only if it helped you to fix it! :)

Thanks,
Prathibha

 
SandhyaSandhya (Salesforce Developers) 
Hi Sangam,

I came up with same solution what Prathibha said.

It works.
 
AND(ISCHANGED( LeadSource ),PRIORVALUE(LeadSource) <>NULL)
Thanks and Regards
Sandhya

 
This was selected as the best answer