Question
In a workflow formula criteria, what's the expected behavior when comparing nulls with the <>
operator?
Details
I've got a basic workflow that seems like it should fire but unexpectedly doesn't. Looking at the debug logs doesn't help clarify the issue.
Workflow is a "simulated" formula field to pull the value from a parent record down to a child. It's setup to fire every time the child field doesn't match the parent then copy the field down to the child. I've got a nearly identical workflow on another field which is working fine, but this one isn't working.
Workflow Setup
- Object: Child__c
- Evaluation Criteria: Every time it's edited
- Rule Criteria:
Field__c <> Parent__r.Field__c
Debug Log (altered for readability)
02:51:30.849 (3849934225)|
> WF_FORMULA|
> Formula:ENCODED:[treatNullAsNull]
> Field__c <> Parent__r.Field__c|
> Values:Field__c=null, Parent__r.Field__c=100
02:51:30.849 (3849942426)|WF_CRITERIA_END|false
Debug Log (raw)
02:51:30.849 (3849934225)|WF_FORMULA|Formula:ENCODED:[treatNullAsNull]{!ID:00N50000002aEzl} <> {!ID:00N50000002aBwS.00N50000002aEzz}|Values:Max_Defensive_Posture_Fixed_Percent__c=null, Strategies__r.Max_Defensive_Posture_Fixed_Percent__c=100
02:51:30.849 (3849942426)|WF_CRITERIA_END|false
Discussion
This isn't terribly hard to work around (just change the formula to true
), but the behavior is perplexing, and I'm hoping someone out there has seen this enough to comment on what's going on (as opposed to just suggesting work arounds). 100 <> null
-> false feels far too 1984-esque comparison could really use an explanation for me and the community.