-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOQL Datatable - Enhance $CurrentRecord api to handle null values #99
Comments
Per discord, just jotting down some notes:
FYI point 3 is technically challenging, specifically because there might need to be lookbehind/lookahead regex. For now, I don't have bandwidth to tackle this (happy to take PRs!) but I might add some limitations to the |
I tried null checking fields on $CurrentRecord but it errors - I think I can only check for nulls in the object I'm querying. However, I am testing things in dev console and it looks like if you replace NULL with an empty string ( Example: So that might be an easy fix...? |
Seems like this is not related to the IN clause / multiple criteria. When using a SOQL query that looks for records that match the id of a $CurrentRecord lookup field, the component throws an error if the lookup field is null.
|
I have a fix working in my org now. I tested all the recipes and they work the same as in another sandbox with a clean installation, except for the two recipes which throw errors in a clean installation (see #101 and #102). Summary of changes to release notes would be:
What is the next step? Should I prepare a PR? Thanks! |
Yep! For this one vet #101 and #102 in conjunction with whatever code you want to include as this #99 feature request. You would open a PR and then fix one or all of the included issues. Don't worry, I can contribute code on top of your fork if I need to pull you in the right direction (or contribute to code reviews). We will do the collaboration workflow:
One thing to keep in mind. The smaller your commits the easier it is to see changes. So, try to keep commits granular and within "context". A good rule of thumb is anything over 200 lines of code changes (that's not XML) should be an upper cap. So long as each commit has enough context/history within a single hash, it makes for collaboration (read: code review) much easier. Good luck and take your time! |
Following up for the future... I believe this needs to apply to text fields also. Take the recipe If you create an account with no mailing state, and some related contacts with no billing state, the contacts will not display. However, if you put the text |
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!
The text was updated successfully, but these errors were encountered: