+ Start a Discussion
srinivasasarmahere1.390217033575374E12srinivasasarmahere1.390217033575374E12 

validation rule on lookup field based on role

The requirement is when a role is creating a case lookup field should not be null

There is a sub role called as "Member_PA" under system Administrator role. and there are two roles Member and PA.

The requirement is if member enters a case validation rule should not fire but if a members PA enters a case validation rule on lookup test field should fire.

lookup field - REP_Customer_Representative__c (lookup to Account)

This is what i came up with but validation rule fires despite the roles.

AND( ISBLANK(REP_Customer_Representative__c),
$UserRole.Name <> "Member_PA" )

Any help is appreciated.

Thanks
Ashish_SFDCAshish_SFDC
Hi ,


Use

AND(( ISBLANK(REP_Customer_Representative__c), ($UserRole.Name == "Member_PA" ) )


Regards,
Ashish