[SalesForce] Referring a lookup in validation rule

I just came across a salesforce documentation to check the limitation of validation rules – https://help.salesforce.com/apex/HTViewHelpDoc?id=fields_validation_considerations.htm&language=th

It says:

Validation Rule Field Restrictions:

Validation rule formulas don’t or can’t refer to:

  1. Compound fields, including addresses, first and last names, and dependent picklists and lookups

  2. Campaign statistic fields, including statistics for individual campaigns and campaign hierarchies

  3. Merge fields for auto-number or compound address fields such as Mailing Address

I tried to refer the lookup field in the validation rule of an object and I was able to validate whether the lookup is blank or not and show an error if the lookup field is blank. I don't understand what it means by

Validation rule formulas don’t or can’t refer to Compound fields,
including addresses, first and last names, and dependent picklists and
lookups

from the documentation link.

Best Answer

You can use it for some formulas such as isblank.

See https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/compound_fields_limitations.htm

The only formula functions that you can use with compound fields are ISBLANK, ISCHANGED, and ISNULL. You can’t use BLANKVALUE, CASE, NULLVALUE, PRIORVALUE, or the equality and comparison operators with compound fields. The equality and comparison operators include = and == (equal), <> and != (not equal), < (less than), > (greater than), <= (less than or equal), >= (greater than or equal), && (AND), and || (OR).

Seems a disconnect in the documentation

Related Topic