SOQL WHERE clause gives inconsistent results with formula fields on related records
Last updated 2020-02-26 ·Reference W-4275672 ·Reported By 4 users
There are sometimes irrelevant results when a SOQL WHERE clause filters on a parent record's formula field that checks for NULL values.
In an org:
1.Create a formula field ID_Null which has formula Id=NULL and return type checkbox.
2. Create another formula field as AlwaysFalse keeping the return type as checkbox and formula as False.
3. Create some Account records which have parents and some which do not have parents.
Run following SOQL in Dev Console:
SELECT id FROM Account WHERE Parent.id_null__c = true OR AlwaysFalse__c = true
- Actual Result
Returns many results
- Expected Result.
No records should be returned.
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.