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

Discussion

Discussion

New Forms Designer: Common Use Cases for Java

posted on August 18, 2021 Show version history

The most common use case I have to use Java for is when I have a task that requires more than three decisions. Submit, Approve and Reject are not enough. This particular example is Approve, Reject, Abstain, and Add to Agenda. In this case we use a decision drop down and hide or show the appropriate button for that decision.

 

I love, love, love what  the new forms designer allows us to do. I want to use it so bad for everything, but I find that if I begin a design in the New Designer I really handicap myself for things like this and wind up having to rebuild the whole form in classic to accommodate a new decision we discovered post-analysis.

***Suggestion for LF Developers: You could allow Field Rules to control the buttons. That would solve for this.***

 

I'd love to hear other use cases here for Java that have really been a staple in your form design.

Java I use most often below:

 $(document).ready(function() {
   
  var $submit = $('.Submit');
  var $approve = $('.Approve');
  var $reject = $('.Reject');
  var $Decision = $('#Field66'); //update with your target decision field
  $approve.hide();
  $submit.hide();
  $reject.hide();
  $Decision.change(function() {
    if ($Decision.find(':selected').val() === "Approve"){
      $approve.show();
      $submit.hide();
      $reject.hide();
    
    } else if ($Decision.find(':selected').val() === "Abstain"){
      $approve.hide();
      $submit.show();
      $reject.hide();
    
    } else if ($Decision.find(':selected').val() === "Reject"){
      $approve.hide();
      $submit.hide();
      $reject.show();
    
    } else if ($Decision.find(':selected').val() === "Agenda"){
      $approve.hide();
      $submit.show();
      $reject.hide();
    
    }
    else {
      $approve.hide();
      $submit.hide();
      $reject.hide();
    }
  });
});

 

4 0
replied on January 6, 2023 Show version history

Forms 11 Update 3 has added support for more action buttons on user tasks which works for both new form and classic form. And you also can use field rule to show/hide action buttons on form for new form.

You can see other changes of Forms 11 Update 3 from  https://support.laserfiche.com/kb/1014413/list-of-changes-for-laserfiche-forms-11-update-3 and get Forms 11 Update 3 from Laserfiche 11 package  https://support.laserfiche.com/kb/1014263/software-versions-and-fixes-included-in-the-laserfiche-11-download-package

1 0
replied on August 18, 2021

Thanks Elexis! We're working on implementing JavaScript in the new layout designer and would love to hear people's answers as to their use cases with JS.

4 0
replied on August 18, 2021 Show version history

Hi Matt!

We use JavaScript on 99% of the forms we build.

This ranges from things as simple as changing the page title in the browser tab from "New Submission" to the actual form title, all the way to more complex things like custom parsley validation and Authorize.Net integrations.

In all honesty, the lack of JavaScript support is the #1 reason we haven't used the new designer yet, because as much as we'd love if everything could be done with built-in functionality, the flexibility of JavaScript is what made Forms so powerful in our environment.

Here are a few of our major/critical use cases that either get used very often or do something we can't afford not to have on some forms:

  1. Setting custom and/or dynamic ranges in date/time fields
  2. Adding/removing read-only attributes to allow JavaScript changes to fields to be properly saved/submitted.
  3. Custom page-by-page validation using parsley groups to force users to complete all required fields before proceeding to the next page.
  4. Custom modal dialogs for confirmation/warning messages.
  5. Hiding form inputs until load lookups are complete for larger forms
  6. Numerous other activities tied to lookup start/finish
  7. Custom reordering/sorting buttons for table rows
  8. Building custom stamp images that are then passed to workflow and stamped on the document in script activities.
  9. Restricting "total" file size for uploads (currently you can restrict the maximum size of a single upload field, but you can't restrict the total size of uploads in a collection or across the entire form for example)
  10. Auto-formatting inputs like phone numbers, or changing inputs to title case, upper case, lower case, etc.
  11. Custom payment integration with Authorize.Net using their hosted credit card input form (we couldn't use the built-in options because we needed customer payment profiles and Authorize Only transactions).
  12. Custom validation for email fields to only accept email addresses from known or government domains for specific forms.
  13. Enforcing uniqueness on table values either for a single column or combination of values/columns (sometimes even file names)
  14. Controlled population of lookup fields and triggering of stored procedures, such as to perform real-time db updates from the form.
  15. Dynamic messages in custom HTML elements, such as text that changes based on inputs/selections or clickable links based on a dropdown.
  16. Working with embedded WebLink/Web Client frames, including interaction with scripts in customized docviewer.aspx pages.
  17. Building dynamic forms using collections, database records, and lookups that modify question labels and show/hide the appropriate input types based on the lookup results.
  18. Expanding the number of button options for user tasks. I found that in the classic designer, you can modify the value of the buttons with JavaScript and that value will be reflected in the instance history and evaluate correctly in gateways (I've mostly used this for troubleshooting pathways when the Submit/Approve/Reject options were already being used for the main process).

 

And that's just some of the stuff I've personally done in the last couple of years.

Because of things like JavaScript in Forms and Scripts/SDK Scripts in Workflow, I've always told people there's really not much you can't do in Laserfiche because even if it doesn't do it out of the box, you can expand it in surprising ways.

 

EDIT: @████████ this is the list I mentioned at Empower. Several of these items have already been addressed by features in the new designer, but the general idea is that I'm more concerned with accommodating unanticipated needs rather than reproducing/replacing the known use cases.

12 0
replied on August 25, 2021

Great list Jason. Some excellent examples above.

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

Sign in to reply to this post.