+ Start a Discussion
Manjunath reddy 25Manjunath reddy 25 

validation rule not works properly

I have written a validation rule  as below,

AND( 
$Setup.Global_Config__c.Mute_Validation_Rule__c <> TRUE, 
OR( 
ISBLANK( Account__c ), 
ISBLANK( Name__c ), 
ISPICKVAL( Role__c , ''), 
ISPICKVAL( Role_Scope__c , ''), 
AND( 
ISPICKVAL( Role__c , "Other"), 
LEN(Role_Scope_Description__c) = 0 


)

but when I click save butonn with empty fields , it is not throwing an error, If we select two or mor fileds it i throwing an error,can some one help me on this.
Nayana KNayana K
Can you please elaborate requirement in detail? In which cases it should throw error and in which cases it should not?
Manjunath reddy 25Manjunath reddy 25
I have written the validation rule on an object HPE Account Team,  we have custom command buttonn save, when we click on save button it should throw an error 'Please Enter Name, Role, Role Scope and make sure Role Scope Description is filled if Role is other'.
 
Nayana KNayana K
Nayana K
Check if this works :

AND( 
$Setup.Global_Config__c.Mute_Validation_Rule__c <> TRUE, 
OR( 
ISBLANK( Account__c ), 
ISBLANK( Name__c ), 
ISPICKVAL( Role__c , ''"), 
ISPICKVAL( Role_Scope__c , ''"), 
OR( 
ISPICKVAL( Role__c , "Other"), 
LEN(Role_Scope_Description__c) = 0 


)