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 Mar 31 '15 at 1:16
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 Mar 31 '15 at 0:39
  • try to just change the == by != – Cloud Ninja Mar 31 '15 at 0:42
  • hi Brovasi, it is still saving the record – syed88 Mar 31 '15 at 0:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.