+ Start a Discussion
Siège DAYTONASiège DAYTONA 

Formula to return an error if several picklist are blank

I'm trying to create a validation rule in order to get an error message if at least one of my all picklists' is blank. I tried to create it with AND() connector instead of the fact that this connector only support two conditions :
 
AND(AND(AND(ISPICKVAL( Visite_Effectu_e__c ,"Oui"),ISBLANK( Dur_e_Visite_Minutes__c )),ISBLANK( Interlocuteur_Pr_nom_Nom_1_del__c)),AND(AND(ISPICKVAL(Fonction_1__c ,""),ISPICKVAL( Pr_sence_d_un_rayon_libre_acc_s__c,"")),ISPICKVAL( Pr_sence_borne_anti_vol__c ,"")))
The logic behind this formula is :
 
AND ( AND ( AND (A,B) , C ), AND ( AND (D,E) , F ) )
If one of A, B, C, D, E or F picklists' is blank, you can't end the report and get an error.

If it's not clear, i can re-explain my problem or my formula ! 

Thank you for your help ! 
 
Best Answer chosen by Siège DAYTONA
Siège DAYTONASiège DAYTONA
I found the solution with a mix of both :D 
 
OR(
AND ( A, B)
AND (A, C)
AND (A,D)
)

 

All Answers

Raj VakatiRaj Vakati
try this code
 
AND(
	AND(
		AND(
		ISPICKVAL( Visite_Effectu_e__c ,"Oui"),
		ISBLANK( Dur_e_Visite_Minutes__c )
		)
	,ISBLANK( Interlocuteur_Pr_nom_Nom_1_del__c)
   ),
   AND
   (
   AND(
    ISBLANK(TEXT(Fonction_1__c))
   ,ISBLANK( TEXT(Pr_sence_d_un_rayon_libre_acc_s__c))
   ),
   ISBLANK( TEXT(Pr_sence_borne_anti_vol__c))
   )
)

 
RD@SFRD@SF
Hi Daytona,

If you are looking for a validation rule which triggers when any one of your picklist is empty. Why not wrap all the picklist in OR?
Something like OR(A,B,C,D,E)

Hope it helps
RD
Siège DAYTONASiège DAYTONA
I tried both solutions but fields ISBLANK( Dur_e_Visite_Minutes__c ) and ISBLANK( TEXT(Pr_sence_borne_anti_vol__c)) don't triggers when it's blank :( do you have any other ideas please? 
Siège DAYTONASiège DAYTONA
I found the solution with a mix of both :D 
 
OR(
AND ( A, B)
AND (A, C)
AND (A,D)
)

 
This was selected as the best answer