LightningFlowComponents icon indicating copy to clipboard operation
LightningFlowComponents copied to clipboard

*QuickLookup* - _(QuickLookup)_ - Semi join sub-selects error

Open solo-1234 opened this issue 3 years ago • 0 comments

Steps to reproduce

Steps to reproduce the behavior:

  1. Build a screen flow with a QuickLookup (I am testing with the most recent version, 1.0.2)
  2. Set the whereClause to something like this: WHERE Field__c = 'xxxx' AND Id NOT IN (SELECT Lookup__c FROM Other_Object__c)
  3. Run the flow and try to click in the lookup
  4. Notice the the toast error: Exception occured: Semi join sub-selects are only allowed at the top level WHERE expressions and not in nested WHERE expressions. Class.LightningLookupController.getRecords: line 76, column 1

Expected behaviour

It should search for the records that meet the criteria

Actual behaviour

Error toast message

Screenshots

https://i.imgur.com/fwMYG4b.png

Debug Logs

Note in the debug log for the apex class, it puts my where clause in parentheses and adds AND (Name LIKE '%%'). When I test THIS query in Dev Console I receive the same error.

USER_DEBUG [34]|DEBUG|======> sObjectName = Object__c, valueFieldName = Id, displayedFieldName = Name, whereClause = (Field__c = 'xxxxxxxxxxxx' AND Id NOT IN (SELECT LookupField__c FROM OtherObject__c)) AND (Name LIKE '%%'), filterField = null, filterFieldValue = null
USER_DEBUG [75]|DEBUG|========> soql = Select Id,Name FROM Object__c WHERE (Field__c = 'xxxxxxxxxxxx' AND Id NOT IN (SELECT LookupField__c FROM OtherObject__c)) AND (Name LIKE '%%') ORDER BY Name Limit 100

solo-1234 avatar Jun 09 '22 17:06 solo-1234