Skip to content

SOQL Datatable - Enhance $CurrentRecord api to handle null values #99

@solo-1234

Description

@solo-1234

I'm having trouble with a query that filters on multiple lookup fields from $CurrentRecord.

I'm trying this: SELECT fields FROM object WHERE Id IN ($CurrentRecord.Lookup_1__c,$CurrentRecord.Lookup_2__c,$CurrentRecord.Lookup_3__c)

Use case is a record that has 3 lookup fields to the same object (for business reasons this made more sense than a junction obj), and I'd like to display a read-only datatable of the (1-3) records.

The datatable shows correctly when a record has all 3 lookups populated. However, if only two are populated, it shows no records and instead says Invalid SOQL String invalid ID field: null

But if I remove the third lookup field from the filter, it shows both records as it should.

(I get the same error if I use OR instead of IN() for the filter)

Any insight? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions