Chaos-Tech-Corp / Input-Field-Lookup

Salesforce Lightning lookup component
GNU General Public License v3.0
26 stars 24 forks source link

No filter issue #6

Open yacari opened 3 years ago

yacari commented 3 years ago

Hello,

First, thanks a lot for the work ! I am just here to present an issue I fixed for your component : In the Apex controller line 57 your checking if the filter is null, in my case I did not set any filter in the component and it was considering the filter as an empty string, so not null. Leading to a wrong query with AND () inside. I just change the check by : if (Filter != '')

Thanks for this component ;)

christiancoleman commented 1 year ago

@yacari I appreciate you calling this out. I didn't have a filter either and ran into search errors. I used the below for my quick fix:

if (String.isNotBlank(Filter) || String.isNotEmpty(Filter)) {
        sQuery += ' AND (' + Filter + ')';
}