I want to create a validation rule on a look up field based on role . There are two roles

  1. Member Member - is a member
  2. Member PA - is a pa to the member

lookup fields - REP_Customer_Representative__c (lookup to Account)

The requirement is when a "member member" creates a case and if the look up field is blank the validation rule should not fire as REP_Customer_Representative__c - is a member representing field

But when a "Member Pa" creates a case he/she should not leave the lookup field REP_Customer_Representative__c - blank

and this is what i came up with, but the validation rule is not getting fired

AND( ISBLANK(REP_Customer_Representative__c), 
$UserRole.Name = 'Member_PA' ) 
  • 1
    Could you please edit your question? It is hard to understand (at least for me :)) Feb 12, 2014 at 18:15
  • i want to create a validation rule on a look up field based on role .
    – Developer
    Feb 13, 2014 at 9:20
  • 1
    Are you sure that is the UserRole Name? It looks more like a Developer Name with the underscore. Apr 27, 2015 at 16:44
  • Agreed. The Name should generally be the human-readable name: 'Member PA' Apr 27, 2015 at 18:26

1 Answer 1


I don't know if this is the answer, but try:

AND( ISBLANK(REP_Customer_Representative__r.Id), 
$UserRole.Name = 'Member_PA' ) 

I seem to recall the validation rules needing to look up a value on the parent (i.e. REP_Customer_Representative__r.Id), not just where there is a value in that field itself.

Let us know if this works... or not.

You must log in to answer this question.

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