Closed szczursonn closed 10 months ago
SOQL's .toValuesOf(field) method returns an empty Set when one of the queried records has the field as null
.toValuesOf(field)
null
System.debug(SOQL.of(Account.sObjectType).toValuesOf(Account.Industry)); // {}
System.debug(SOQL.of(Account.sObjectType).whereAre(SOQL.Filter.with(Account.Industry).isNotNull()).toValuesOf(Account.Industry)); // {Education, Mining, Manufacturing...}
.toValuesOf(field) returns a Set with all values when extracting a nullable field, including null
SOQL's
.toValuesOf(field)
method returns an empty Set when one of the queried records has the field asnull
STEPS TO REPRODUCE
Expected behavior
.toValuesOf(field)
returns a Set with all values when extracting a nullable field, including null