Section | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
This JavaScript example is relevant to Forms only. Let's say you have a new customer registration Form A that is normally forwarded to Forms B and C to complete registration for a new user. Returning Users skip Form B and go directly to form C.
This JavaScript example will automatically submit a form if a certain control has some specific value (say “not-new”) in it when the form is loaded. This might be useful in cases where a form needs to be submitted to post the data in it, but interaction between the form and user is not necessary. If the user's input is not required, this custom JavaScript can submit the form automatically.
...
Workflow steps only allow for one Activity Document Action (ADA), but there are cases where you may want to configure a second ADA (such as a second email) from the same workflow step. If the step is at the end of the workflow, you can use Workflow Doc Actions to accomplish this task. For steps in the middle of a workflow, create an additional linked step, set up the second ADA on the added step, and then use a script to automatically submit that step so the users will not see it. The script is similar to that for Automaticallysubmitaform 1507406127, but one key difference is that you will need a rule on the form that sets your conditional-submit control to the value specified in the script ("next" in the example below) on the step that should auto-submit, and then use the else action to set that control to empty on all other steps. Add conditional-submit to the CSS Class property of the control whose value is to be compared.
...
This JavaScript example will submit the form when the user presses the Enter key. If you want to do this in a workflow, change SubmitView.doSubmit("Submit"); to FlowView.getFlowButton().onclick();
...
Code Block | ||
---|---|---|
| ||
if( getCusomterNameTrigger.clicked ){ customerName.value = getCustomerName(http, customerId.value); } |
Auto Save Script
To avoid losing data if the user accidentally closes the window or if the form times out, you can add a custom javascript that will save the form at regular intervals. This script can be directly added on the form or worklow in a message control or to a project level include.js file. Please note that any data after the last save ran will be lost if the form is closed or timed out. Please set your timer accordingly.
Note |
---|
Please ensure that the Save/Load property is checked in the settings for this script to run successfully. |
To add this script to a standalone form or workflow, add a message control to it . You can set the properties of the message control from the properties panel to Visible false and Printable false if you don't want it seen at runtime or printed in the final pdf. The variable "actualtimer" is the interval between each save. actualtimer=1 equates to 1 minute. The script for a form and a workflow slightly differ.
Script for a form,
Code Block | ||
---|---|---|
| ||
<script>
var actualtimer = 1
var saveInterval = 1000 * 60 * actualtimer;
autoSaveForm = function ()
{
_frevvo.formView.getSaveButton().click();
setTimeout(autoSaveForm, saveInterval);
}
setTimeout(autoSaveForm, saveInterval);
</script> |
Script for a workflow,
Code Block | ||
---|---|---|
| ||
<script>
var actualtimer = 1
var saveInterval = 1000 * 60 * actualtimer;
autoSaveForm = function () {
FlowView.getSaveButton().click();
setTimeout(autoSaveForm, saveInterval);
}
setTimeout(autoSaveForm, saveInterval);
</script> |
If you already have an include.js file or want to upload this script at a project level, just remove the <script> and </script> tags from the above code and make sure your include.js file has // frevvo custom JavaScript comment at the top of the file.
Info | ||
---|---|---|
| ||
Anonymous users or users not logged into the system will be prompted to enter their email address when the save event is triggered. |