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

Discussion

Discussion

Forms - Script and saving to repository - rendering

posted on January 30, 2019

Hello,

I am supporting several forms processes that have two forms in each process, one for the initial form submission and one for saving to the repository. They are essentially duplicate forms, but the repository one is stripped of lookup rules, jquery code so that it statically displays the process variables resulting from the initial form submission. Otherwise, if we try to save the initial form version with script, it saves it in the preliminary state before all data is retrieved, etc.

 

This approach is tedious as it requires maintenance on both forms anytime something is changed related to verbiage, etc. Is it possible in jquery to detect that Forms is rendering it to save to repository and then code to allow for that? If so, how do you detect that? I'm familiar with the step_id variable and am guessing it is related to that?

 

Thanks,

Julie

0 0
replied on January 30, 2019

Have you considered having some sort of waiting status before (or when) user clicks Submit that would load everything in and eliminate the need for the second form? Depending what all your JS code does (because some JS changes don't get saved unless you code it in a certain way) that might an easier way to handle this scenario.

0 0
replied on February 8, 2019

Sounds intriguing but I'd need more info to understand specifically how to implement.

Thanks,

Julie

0 0
replied on February 11, 2019

Julie, are your lookups taking a long time? If they are, do you mind if I ask how are they setup to pull? For example: if you are looking up a document in the repository, the LF Repository database is not optimally organized for lookups (because one entry can have multiple rows, each metadata field listed in it's own row) - instead you will want to create a SQL View that will unite all metadata for a particular entry into one row.

If you have issues with data saving from javascript changes, there are a few posts on this site I can reference for you to help with that. Javascript will populate a read-only field but when you submit the form it will default to previous input (usually blank).

As for lookups, another alternative is to use the  "lookupcomplete" and/or "lookupstarted" function: https://answers.laserfiche.com/questions/108471/Can-we-get-a-lookups-complete-custom-event-listener-please
You can even add a little loading icon and a screen-overlay to prevent input while it finished loading.

0 0
replied on February 15, 2019

I'm not sure you are understanding my question. Having to create two forms is a function of what forms does under-the-covers when it does the Save to Repository step. I'm not having a problem with long-running lookups (I just use SQL stored procs)... it's more a sequencing thing how Save to Repository only saves an image of the document at the start of the javascript (vs how it ends up looking rendered after all lookups).

So if I have a message display at the start of my javascript "Please wait until your form loads" (which ultimately goes away after the data loads), when I have a Save to Repository for that same form, the image is saved with the "Please wait until your form loads" vs showing the actual data in the TIFF image saved in LF.

 

I'm guessing there must be a way to detect in my javascript that forms is rendering the image for saving to repository (vs the regular startup for an actual user) which would allow me to code around it.

 

Thanks,

Julie

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

Sign in to reply to this post.