[SalesForce] Validation Rule IF A Specific Picklist Value is Selected

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

Best Answer

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.