0

I am trying to make a validation rule on Lead that will be for one profile and one role. The rule says that if the specific picklist value is selected and if one field in empty and then it should validate. Here is what I have come up with

AND( 
$UserRole.Name = 'Career Advisor - Inbound' , 
$Profile.Name = 'Acquire Sales Admin - Inbound', 
AND 
  (ISPICKVAL(Lead_Sources_for_Career_Advisor__c, 'Career One'),
   ISBLANK(Lead_Source_Referral__c)
  ) 
)

The problem is that the rule is not working. I can't figure out the reason for it. Any suggestions will be highly appriciated.

Thanks guys

1
  • Validation rules, if they return TRUE, throw the validation error. What did you mean by 'it should validate' ? You can examine the debug log to see what values are passed to the Validation Rule
    – cropredy
    Commented Mar 31, 2015 at 1:16

2 Answers 2

1

If you want to return a validation error on a record that does not comply with your rules then you should wrap it inside an IF clause like this.

IF(
AND( 
$UserRole.Name == 'Career Advisor - Inbound', 
$Profile.Name == 'Acquire Sales Admin - Inbound',
AND(
ISPICKVAL(Lead_Sources_for_Career_Advisor__c, 'Career One'),
ISBLANK(Lead_Source_Referral__c)
)
), false, true)

This will give an error when this formula is not met.

0

Try

AND( 
$UserRole.Name = 'Career Advisor - Inbound' , 
$Profile.Name = 'Acquire Sales Admin - Inbound', 
TEXT(Lead_Sources_for_Career_Advisor__c) == 'Career One',
ISBLANK(Lead_Source_Referral__c)
)
3
  • Thank you for your answer. Actually "Lead_Sources_for_Career_Advisor__c" is a picklist and i want to select "Career One" as a picklist value from it
    – syed88
    Commented Mar 31, 2015 at 0:39
  • try to just change the == by !=
    – brovasi
    Commented Mar 31, 2015 at 0:42
  • hi Brovasi, it is still saving the record
    – syed88
    Commented Mar 31, 2015 at 0:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .