Discussions

 View Only
  • 1.  Routing User to Different Form Based on Field Value

    Posted 05-31-2022 08:37
    Edited by Justin Ferris 05-31-2022 12:23
    Hello,

    I have a process where users view a case file and work the file. We have grown so now we have several different types of case file and need to use a different form for each file type. I can imagine several ways to do this, but none are clean. Below is a list of what we tried.

    • We tried using an iframe that linked to a formula url field, this worked except is displays the QB header twice and limits the screen size (iframes are apparently not responsive in QB).
    • We tried using one "mega-form" with conditionals, but we hit the embedded report limit and certain fields need to be on multiple forms which QB disallows.
    • We tried creating a different table for each file type but that breaks QB search widget (search widget can only search 1 table at a time).
    • The best solution we found was to create a rich text field that displayed a link to the various case type forms, but then we lose the functionality of the edit and view buttons that display on every report and the search widget.

    Are there any other solutions to this issue?

    Edit: The real issue seems to be QB does not support building code at the routing stage of the application. Is this common web application functionality being considered for a future update?

    ------------------------------
    Justin Ferris
    ------------------------------


  • 2.  RE: Routing User to Different Form Based on Field Value

    Posted 05-31-2022 14:23

    Hi Justin,

    You could use a rich text formula field to display a button that would take you various forms based on a field value.   

    Something like this assuming the value is just simple number value:

    var text myURLone = URLRoot() & "db/" & [_DBID_JOBS] & "?a=er&dfid=21&rid=" & [Record ID#]  //takes you to form id 21 in edit mode
    var text myURLtwo = URLRoot() & "db/" & [_DBID_JOBS] & "?a=dr&dfid=14&rid=" & [Record ID#]    //takes you to form id 14 in display mode

    Case([MY VALUE],
    '1', "<a class='Vibrant Success' style='border:1px solid #ffffff; background-color:#f2274c' href="&"\""& $myURLone &"\""&">URL1</a>",
    '2', "<a class='Vibrant Success' style='border:1px solid #ffffff; background-color:#f2274c' href="&"\""& $myURLtwo &"\""&">URL2</a>"
    )

    You can customize what the button looks like for each condition as well.   Also note that you can drop them into the form in 'edit' mode or 'display mode'.



    ------------------------------
    Jeff Peterson
    ------------------------------



  • 3.  RE: Routing User to Different Form Based on Field Value

    Posted 06-01-2022 11:01
    This sounds like it could be done fairly simply it just depends on how they are getting to the records I guess.

    Have some kind of identifier on the record that says the type it is. Have a formula that then determines the right dfid based on the type. You may need to create your own edit and view buttons, this can be done in rich text and used to replace the the native buttons by hiding the native ones in the report itself. This would allow the edit and view buttons to take into account the dfid formula I mentioned above and take users to the correct form based on the doc type.

    I can break that down further into actual code that may be needed if you want, let me know. I figured just giving the idea for now might spark something.