0

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.

1 Answer 1

2

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

3
  • Thanks. Does the same apply for lookup fields also?
    – SfdcBat
    Sep 9, 2016 at 6:33
  • Yes as the previous info you posted says a lookup is a compound field and based on you trying it and it works
    – Eric
    Sep 9, 2016 at 6:38
  • Makes sense. since lookup fields can't be used for any kind of computation or comparison. It can only be checked if it is blank or null.
    – SfdcBat
    Sep 9, 2016 at 6:43

You must log in to answer this question.

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