You are viewing limited content. For full access, please sign in.

Discussion

Discussion

Bug Found: LFForm.onLookupDone does not work as intended

posted on November 19, 2024

I noticed that the function onLookupDone is actually doing the same thing as onLookupTrigger, where the contents of the function are running on lookup rule startup instead of end. 

 

After noticing this within Laserfiche forms, I took another look at the documentation and noticed that the handler for both functions is the same. Both stating:
"handler: The function to call when a lookup is triggered."

 

I attached a picture of the documentation below.

 

0 0
replied on November 19, 2024 Show version history

I can't speak to the current version of Laserfiche you are on, but I've tested both cloud and self-hosted  v12 and there is a difference in timing of the two events. I think the incorrect description in the documentation implies you can access the values of the filled lookup fields within this event. In practice this event does not necessarily indicate the form has been filled in its entirety (i.e., 4 columns in a table). I'll figure out if this is intended or not and either fix the documentation or fix the onLookupDone handler. This is actually the intended behavior, I am working on updating this specific documentation page shortly so I'll get the wording/examples fixed as well as provide the expected solution

 

Regardless, I typically push people to use the onFieldChange function as that not only captures the lookup completion but also any user edited values all in one go. It is slightly more complicated to handle the onFieldChange for multiple fields at once but its realistically only a matter of a few if/then statements.

1 0
replied on February 17 Show version history

Hi Zach-

I might be speaking to something other than what you are, but I'm not having luck with either onLookupDone or onFieldChange.

I have a lookup that for some reason is running really slowly. I'd like to somehow let the user know that it's working. But whether the lookup automatically runs or I use the Autofill button, the complete and field change both trigger immediately even if the actual, visual confirmation of the field lookup doesn't happen for another 15 seconds.

I might be able to work around it by sending another value back in the lookup to a hidden field, but it makes the JS related to lookup completion seem useless. (For my purposes; I'm sure under the hood it's doing a lot of stuff and working as intended.)

To be clear, I'm using self-hosted version 11.0.2311.50564

0 0
replied on February 18

what field are you listening to with your onFieldChange? You should listen to the field defined last in the fill field section of the rule 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.