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

Discussion

Discussion

Bug Found: LFForm.onLookupDone does not work as intended

posted one day ago

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 one day ago 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
You are not allowed to follow up in this post.

Sign in to reply to this post.