Discussions

Expand all | Collapse all

Declared forms vs default forms when saving a record and displaying it

  • 1.  Declared forms vs default forms when saving a record and displaying it

    Posted 30 days ago

    I am stumped on this and would be grateful for any guidance.

    Intended Workflow:

    1. The user opens a record in edit mode, using a link provided
    2. They enter fields in the form and hit the "Submit" button
    3. The record saves, and an "On Save" form rule sets a flag on the record
    4. The record then reopens in display mode using the same form (which displays different sections based on the flag set above)

    The constraint is that I cannot use the default form on the roles to control this behaviour.


    I have formulated the link in this manner:

    var text URL = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID]&"&dfid=40";  //NOT the default

    var text Words = "My Link here";

    "<a href=" & $URL & ">" & $Words & "</a>"

     

    I've created a custom "Submit" button in this manner:

    "<a id='Testsavebutton' class='Vibrant Success' onclick='DoSaveAdd()' href='#'>Submit</a>"

     

    When the user clicks the custom "Submit" button, the record saves, briefly showing declared form 40 in the background, then displays the record using the default form instead.  I cannot get it to display the record in the form I declare.

     

    Things I've tried unsuccessfully:

    • Changing the link provided by using the &NextURL parm (with the dfid parm included)
    • Changing the link provided by using the &rdr parm (with the dfid parm included)
    • Changing the custom submit button to use Linkaway
    • Changing the custom submit button to use DoSave

     
    Some combinations above will open the record in the default form in edit mode, some will open the record in the default form in display mode, but nothing I have tried will open the record in the declared form in display mode.

     

    Anyone have a suggestion?

     

    Thanks,



    ------------------------------
    Ian Ward
    ------------------------------


  • 2.  RE: Declared forms vs default forms when saving a record and displaying it

    Posted 30 days ago
    Can you show your code for using the &NextURL and explain what that does on save?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 3.  RE: Declared forms vs default forms when saving a record and displaying it

    Posted 29 days ago
    I feel a bit foolish.  When I looked at the &NextURL code I saw the issue.  I hadn't wrapped that section with URLEncode function.  I was passing a bad URL as a result, which caused the form to revert to the default.

    For the record, here is the working code:

    Link used to open the record in edit mode
    var text URLEDIT = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & [Record ID]&"&dfid=40";
    var text URLDisplay = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID]&"&dfid=40";
    var text URL = $URLEDIT & "&NextURL=" & URLEncode($URLDisplay);
    var text Words = "My link";
    "<a href=" & $URL & ">" & $Words & "</a>"

    Custom Submit button
    "<a id='Testsavebutton' class='Vibrant Success' onclick='DoSaveAdd()' href='#'>Submit</a>"

    Thansk for your help.

    ------------------------------
    Ian Ward
    ------------------------------



  • 4.  RE: Declared forms vs default forms when saving a record and displaying it

    Posted 29 days ago
    OK, so all good now. Great.
    Mark

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------