LightningFlowComponents icon indicating copy to clipboard operation
LightningFlowComponents copied to clipboard

LookupFSC Issue with apostrophe

Open Seanman236 opened this issue 8 years ago • 9 comments

When using the latest version of the LookupFSC, it appears that there's an issue if a user types in an apostrophe after a letter.

For example, if the component is set to look up a formula field on the contact table with no filters or additional clauses, when searching for Molly O'Keefe, immediately after typing the apostrophe an error toast appears with the following:

Exception Occured: like 1:80 no viable alternative at character '%' Class.LightningLookupControlled.getRecords: line 69, column 1

However, the search does return Molly OKeefe if the user omits the apostrophe.

Seanman236 avatar Aug 08 '18 18:08 Seanman236

I just tested and did not see that error. When did you install your version?

ericrsmith35 avatar Aug 08 '18 19:08 ericrsmith35

I just installed the version from Unofficial Flow Google Site earlier today. When I click the link to install it from there I am directed to an app exchange page for the LookupComponent FSC. For July - Default Vals2 (1.4).

Screen Shot 2018-08-08 at 3.50.51 PM.pdf

Seanman236 avatar Aug 08 '18 19:08 Seanman236

I've found an alternative component on the appexchange (but it lacks the overall polish of this). Were you able to reproduce this error? I've loaded the most recent posts from the unofficial flow into a few test orgs as well and it occurs each time. I took a look at the class where it says the error is occuring but the soql query is a bit beyond my skills to interpet. I adjusted the type head length from 2 to 1 and to 3 and can confirm it's not the presence of the single quote itself, but something from when the typeahead begins the search to whatever is being returned. Because it's showing the % in the error log, I think this might be some sort of unintended injection into the soql query.

I spent a few hours trying to see if using escapeSingleQuotes would resolve it but was unsuccessful. Thought I'd send a note before continuing to dig into this.

PS. FWIW: I am getting the error when using the component in a flow that is embedded in a community via flow component.

Thanks for all your work on these - totally changed the type of experience we are able to offer our members.

Seanman236 avatar Sep 05 '18 22:09 Seanman236

I am not able to reproduce your issue. In my case, anything I type after the ' does not factor in the filtered results.

What is the alternate component?

I started out modifying the original component because I had a need in my org to have some lookup fields dependent on a previously selected value such as only presenting Contacts related to a previously selected Account.

ericrsmith35 avatar Sep 05 '18 23:09 ericrsmith35

The component is called "universal Lookup Field Component".

In each org I've tested (a few sandboxes and developer orgs) The error toast appears upon input of the ' and then the lookup box fails to work. Interestingly, if you just type the name without the ' it still is able to query it. Bummer that you're not able to recreate it but that makes me think that I must have the wrong build. Could you send a link to the version you're using - my most recent install is the one from the unofficial flow.com Google site.

On Wed, Sep 5, 2018 at 7:34 PM Eric Smith [email protected] wrote:

I am not able to reproduce your issue. In my case, anything I type after the ' does not factor in the filtered results.

What is the alternate component?

I started out modifying the original component because I had a need in my org to have some lookup fields dependent on a previously selected value such as only presenting Contacts related to a previously selected Account.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexed1/LightningFlowComponents/issues/66#issuecomment-418914816, or mute the thread https://github.com/notifications/unsubscribe-auth/AV_nXm1IK7ubNNNH9lkeQeZysnF3m_c8ks5uYF-YgaJpZM4V0egl .

-- Sean Malinoski 202-591-5505

Seanman236 avatar Sep 06 '18 15:09 Seanman236

Here is what I have in my system. https://login.salesforce.com/packaging/installPackage.apexp?p0=04t0e000000A5Ki

ericrsmith35 avatar Sep 06 '18 16:09 ericrsmith35

I installed it in a new org, and loaded it into a dummy flow and embedded it in a community and the class is still having an issue - though in a different location - line 49 instead of 80 this time. It's weird that this only occurs when I am using an apostrophe (as in what is next to the return key) not the single quote which is next to the 1 key (which does work correctly along with all other symbols I've tried).

I spent some time looking at the class and the javascript helper seeing if using EscapeSingleQuote method would do anything but I've been unsuccessful and I'm a little lost in trying to figure out exactly where the search input is being passed in and could be modified with method.

I appreciate all you're time helping given you aren't able to reproduce - I'm wondering if this is due to me configuring the component incorrectly. If you get a second could you send a screenshot of how you have it configured in one of your flows?

On Thu, Sep 6, 2018 at 12:46 PM Eric Smith [email protected] wrote:

Here is what I have in my system.

https://login.salesforce.com/packaging/installPackage.apexp?p0=04t0e000000A5Ki

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alexed1/LightningFlowComponents/issues/66#issuecomment-419163498, or mute the thread https://github.com/notifications/unsubscribe-auth/AV_nXtYW1wdyue_nBeQ_oZfCrcuCIAINks5uYVFpgaJpZM4V0egl .

-- Sean Malinoski 202-591-5505

Seanman236 avatar Sep 06 '18 18:09 Seanman236

Sure, take a look here: https://sites.google.com/view/flowunofficial/flow-screen-components/lookup

ericrsmith35 avatar Sep 06 '18 19:09 ericrsmith35

Thanks!

On Sep 6, 2018, at 3:31 PM, Eric Smith [email protected] wrote:

Sure, take a look here: https://sites.google.com/view/flowunofficial/flow-screen-components/lookup

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Seanman236 avatar Sep 06 '18 21:09 Seanman236