+ Start a Discussion
domdickdomdick 

Help require on VR for leads

Hello,

I am trying to make a Leads VR to make sure no-one can change a "lead source" after it is created.
I have came up with following formula

AND(ISCHANGED(LeadSource), NOT(ISPICKVAL(LeadSource , "")))

 
It does pop up the message if someone will try to change but if it doesn't show the message if l change lead source to blank.
Can someone please assist me to wirte a correct VR for no-one can change a "lead source" to other vaule, not even blank?

Thanks


Best Answer chosen by Admin (Salesforce Developers) 
SAPOCSAPOC

here try this

 

AND( ISCHANGED( LeadSource ) ,NOT( ISPICKVAL( PRIORVALUE( LeadSource ) ,"" ) ))

All Answers

SAPOCSAPOC

Just give

ISCHANGED( LeadSource)

domdickdomdick

Thanks SAPOC,

 

But if i place this VR active now then if any record has been created in past with Lead Source blank then it wouldn't allow to change to any value. Any further implement on above VR?

SAPOCSAPOC

here try this

 

AND( ISCHANGED( LeadSource ) ,NOT( ISPICKVAL( PRIORVALUE( LeadSource ) ,"" ) ))

This was selected as the best answer
SteveMo__cSteveMo__c

Give this one a shot

AND(
ISCHANGED(LeadSource), 
NOT(ISPICKVAL(PRIORVALUE
(LeadSource), "")))

 

SteveMo__cSteveMo__c

**bleep**! @ you beat me by 2 minutes!  ;-P

domdickdomdick

Thanks to both. I will "thumps up" for both!

Really appriciate!

domdickdomdick

Sorry to be pain asking another exception on above VR.

How can i make sure only specific user allow to change?

SAPOCSAPOC

AND( ISCHANGED( LeadSource ) ,NOT( ISPICKVAL( PRIORVALUE( LeadSource ) ,"" ) ), NOT( $User.Id ="****") )

domdickdomdick

Thanks a lot SAPOC!