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
Kirsty BeyersKirsty Beyers 

Validation rule to force a field when lead is at a certain stage

I am trying to see where I have gone wrong with the following validation rule - I am simply wanting to force three fields when a lead status is set to Qualified. Currently, the error pops even when the lead status is Open? I have tried dozens of different formulas, to no avail.

AND(OR( 
ISPICKVAL(Status__c , "Qualified"), 

(OR(( 
ISPICKVAL( Channel_Type__c , "")), 
ISPICKVAL( Channel_Partner__c , ""))), 
ISPICKVAL( Channel_Source__c , "")) 
)

I also tried the following, but no error popped up:

AND( ISPICKVAL(Status__c, "Qualified"),
OR( ISBLANK(TEXT(Channel_Type__c)),
ISBLANK(TEXT(Channel_Partner__c)),
ISBLANK(TEXT(Channel_Source__c)) ) )


TIA
Best Answer chosen by Kirsty Beyers
Saravana Muthu 8Saravana Muthu 8
If it's the correct Lead Status field then there should not be Status__c it should be Status.

So you have use like below.

AND(OR( 
ISPICKVAL(Status,"Qualified"), 

(OR(( 
ISPICKVAL( Channel_Type__c , "")), 
ISPICKVAL( Channel_Partner__c , ""))), 
ISPICKVAL( Channel_Source__c , "")) 
)

Thanks,
Saravana

All Answers

Saravana Muthu 8Saravana Muthu 8
Hi,

Can you please let me know the data type for channel type ,channel partner and channel source fields ?

Thanks,
Saravana
Kirsty BeyersKirsty Beyers
Hi Saravana, the data type is a picklist. 
Saravana Muthu 8Saravana Muthu 8
Please use the below formula.

AND( ISPICKVAL(Status__c, "Qualified"),
OR( ISPICKVAL(Channel_Type__c," "),
ISPICKVAL(Channel_Partner__c," "),
ISPICKVAL(Channel_Source__c," ")

THANKS,
Saravana
Kirsty BeyersKirsty Beyers
Hi Saravana, I tried this formula & when the status is updated to Qualified, it allows me to save the lead without updating the Channel Type, Partner & Source. My validation rule is activated. Any suggestions? Many thanks
Saravana Muthu 8Saravana Muthu 8
Sorry try the below.

AND( ISPICKVAL(Status__c, "Qualified"),
OR( ISPICKVAL(Channel_Type__c,""),
ISPICKVAL(Channel_Partner__c,""),
ISPICKVAL(Channel_Source__c,"")))

Thanks,
Saravana

 
Kirsty BeyersKirsty Beyers
Thanks Saravana, but the problem persists! I have tried numerous different formulas, but it still doesn't prevent the lead status going to Qualified when the Channel Type/Partner & Source are blank. What could be the issue? TIA

My first formula (as below) worked, but it was triggering when the lead status was open.

AND(OR( 
ISPICKVAL(Status__c , "Qualified"), 

(OR(( 
ISPICKVAL( Channel_Type__c , "")), 
ISPICKVAL( Channel_Partner__c , ""))), 
ISPICKVAL( Channel_Source__c , "")) 
)
Saravana Muthu 8Saravana Muthu 8
I think may be you are referring the custom status__c field instead of Status standard field in validation rule.

Thanks,
Saravana
Kirsty BeyersKirsty Beyers
Thanks Saravana. I have double checked & it is the correct standard Lead Status field.
Saravana Muthu 8Saravana Muthu 8
If it's the correct Lead Status field then there should not be Status__c it should be Status.

So you have use like below.

AND(OR( 
ISPICKVAL(Status,"Qualified"), 

(OR(( 
ISPICKVAL( Channel_Type__c , "")), 
ISPICKVAL( Channel_Partner__c , ""))), 
ISPICKVAL( Channel_Source__c , "")) 
)

Thanks,
Saravana
This was selected as the best answer
Kirsty BeyersKirsty Beyers
Thank you so much Saravana - that worked! I didn't even realise that was where I was going wrong. Much appreciated!