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

Question

Question

Javascript for Modern Form Designer - Issues - Classic Form Work Around for Upload Field

asked on October 12, 2023

I have converted the Classical forms to Modern Form.

The previous issue regarding the validation in upload feild is working, however, now I have problems with Javascript. The Javascript doesnot work in the new form or it is made more difficult to code, I must say not quite userfriendly.

Following are the feature I would like to be able to have:

1. I need a feature to be able to do with Javascript to check barcode if that has been scanned previously utilizing the mobile app memory by inserting Global variables into the Laserfiche App's Config file as a temporary memory. And also to be able to alert the form user with a pop up message "the barcode was scanned previously" if it finds the same barcode in the memory.

This is a very not to ignore feature for our project process. It is/was working fine in Classic Form designer. The upload section had bug not being able to resolve and no ETA from support, hence why I switched to Newform, but many problems prevail. Not so confident with new forms, no freedom. :)

2. Now that I have upgraded the Form to Upgrade 4 after support's recommendation, I cant use the earlier version phone app which was working fine. " When the app tries to connect to the Forms server there is an error saying " Forms server cannot be reached {0} {1}"


Note: Offline forms are  very crucial part of our business process and 99 percent of processes are done utilizing offline forms.

The work arounds I have implemented in Classical forms are :

1. Hide Submit button , but found out that it doesnot unhide the Submit button as the uplod field doesnot correspond to the script.

2. Forced the camera to open ( utilizing javacode ) when condition met, users do not have to click upload button to access camera which is great, but still if the user skips the camera accidently/intentionally it wont work as the validation again doesnot work. The forms will fail.

Does anybody have any recommendations?

1 0

Replies

replied on October 13, 2023

You are correct that Javascript in the modern designer is going to be very different than in the Classic Designer.  The Modern Designer doesn't use JQuery and it runs in a Sandboxed iFrame, so it does not have direct access to the Fields/Form/Window components, but rather limited to the LFForm object (see Help files regarding LFForm object).

Regarding your firest request to hide the submit button.  The Modern Designer can do this with Field rules, so that's one area where things are easier in the new designer.

For your second request, it sounds like you are triggering the click of the upload button based on other criteria instead of the user needing to click that button manually.  If that is the case, then unfortunately, I don't have any suggestions regarding how to complete that in the Modern Designer.

The Modern Designer is going to continue to improve, but at the moment, there are definitely use cases where the Classic Designer continues to be the best choice to solve a problem, and cases where the Modern Designer is better, you just have to weigh your options and needs and make that decision for each process/form/task.  I'm personally using both designers quite heavily, based on need.

Good luck!

1 0
replied on October 14, 2023

I agree with Matthew, Javascript in Modern Forms is purely LLForm Object manipulation.   Laserfiche App however should be a user experience with Forms and Tasks that are accessed and processed in the current session of that the app while is in use.  Hence there should be global variables that programmatically accessed by all instances in that session on that device. 

You can create your own Global variable through lookups tables whilst online.

You cannot create a Global Variable in an offline case.

Steps would be Laserfiche use the Modern Form Designer to create an Offline Variable and add a Javascript LFForm Object to read/write/update/Insert to that variable.

 When you Save a Form Offline that Variable is written into the temp file in Config Folder of the App and accessed by the JavaScript object 

Use Case Offline

Read Barcode from paper with camera and check previous Barcodes used that session in the app.  If the read barcode is present then reject the input. If not then present accept the input and click submit. Upon Submit append accepted Barcode to the previous barcode list in temp.

A special form can be used to clear the variable at any time.

 

 

 

 

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

Sign in to reply to this post.