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
EricVlachEricVlach 

Simple validation not validating. What am I missing?

What am I doing wrong? I am baffled...

I have a lookup field, it is required via validation (originally part of a more complex validation, but the entire thing wasn't working so I broke down the components until I found the culprit - the lookup field)

The system log shows:

*** Beginning [custom object] Validation Rule Evaluation for [record ID]
Start Time: [start time]
Rule Name: Lookup_Required
Error Condition Formula: ISNULL(Contact__c )
Value(s) Found: Contact__c=null
Result: PASS - Continue

End Time: [end time]
*** Ending [custom object] Validation Rule Evaluation for [record ID]


Why oh why is it passing!? Shouldn't ISNULL(lookup__c) return TRUE? Am i missinterpreting the ISNULL() function? Help please...
--------------------------
Edit: upon further investigation, adding NOT() to the formula returns TRUE and fails the save even when there is a value.
Test 1 - with a lookup contact:
Error Condition Formula: NOT(ISNULL( Contact__c ))
Value(s) Found: Contact__c=0037000000cxNeI
Result: FAIL - Save Prevented

Test 2 - without a lookup contact:
Error Condition Formula: NOT(ISNULL( Contact__c ))
Value(s) Found: Contact__c=null
Result: FAIL - Save Prevented



I hate to cry bug, but... bug?

Message Edited by EricVlach on 12-01-2008 12:38 PM
SteveBowerSteveBower

Try:

LEN(lookup__c ) = 0