function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
beenerbeener 

validation rule to require lookup field

Hi,

 

I would like to enforce a lookup field to be 'required'. 
I want to do this using a validation rule (I wish there was a 'required' checkbox for lookup fields), doing this on the page layout level is insufficient for my needs.

 

I've tried to set up a validation rule

 

ISNULL( Team__c )

But this failed to trigger even in cases it should have.

 

Any ideas?

 

Thanks

 

 

Best Answer chosen by Admin (Salesforce Developers) 
RpeeRpee

Lookup fields can not be NULL. Only numbers, dates, currency, etc? can be null. Text and lookup fields can be blank though and therefore have a length of zero.

 

LEN( Team__c ) = 0