Forum Discussion

MikeMike3's avatar
MikeMike3
Qrew Trainee
9 years ago

How can I add a URL button that will allow users to save/update and stay in current record and form? Currently returns to form select form.

Currently I have a Site Visit table with multiple forms that the users select when created a record.  After they save the record Quickbase takes them back to the form select form.  (I inherited this)  How can I add a URL button on the form to save/update changes to the record and keep the user in the current form and record.

26 Replies

  • See if this idea works

    var text Edit = URLRoot() & "db/" & Dbid() & "?a=er&dfid=10";

    var text ViewOnFormTen = URLRoot() & "db/" & Dbid() & "?a=dr&dfid=10&rid=" & [Record ID#];

    var text URL = 
    $Edit
    & "&NextURL=" & URLEncode($ViewOnFormTen);

    var text Words = "click here";

    "<a href=" & $URL & ">" & $Words & "</a>
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    That opened a fresh form. I don't need it to edit. The 'Update' button puts the form in edit mode. I just need it to save and display the correct form. Isn't there a way to amend the onclick='DoSaveAdd() so that it displays the current form upon save?
  • Sorry the first line was supposed to read

    var text Edit = URLRoot() & "db/" & Dbid() & "?a=er&dfid=10&rid=" & [Record ID#];
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    But that's still an 'edit record' command. I'm not looking for the button to edit the record. I just want it to save it. The form is already in edit mode and has been edited. I just want to click a button that saves like 'onclick='DoSaveAdd() ', but I need it to stay on the same form. 
  • I'm suggesting that they use the edit button and then the regular save button will stay on the proper form.  I don't know how to change the DoSaveAdd button to force a particular form, so I'm offering up an alternative solution.
  • Thx for letting me know it worked.  I guess that you are still "stuck" with the native edit button at the top right, but that native Edit is pretty subtle compared to your row of matching buttons which look more inviting to click. 
  • KellyBianchi's avatar
    KellyBianchi
    Qrew Assistant Captain
    Not entirely... I have reinstated the DoSaveAdd and retained my save button, and it works just as the native button does :) Win, win!
    • JanaBaker's avatar
      JanaBaker
      Qrew Cadet
      Kelly...what was the final code that you implemented to make it work properly?  I'm trying to accomplish the same thing. :)
    • KellyBianchi's avatar
      KellyBianchi
      Qrew Assistant Captain
      Remember, this is a row of navigation, so the one you want is 'Update Info' (bolded). 


      // Begin button style
      var text ViewOnFormThirtyOne = URLRoot() & "db/" & Dbid() & "?a=dr&dfid=31&rid=" & ;
      var text bgcolor = "#4b72b0";
      var text txtcolor = "white";
      var text URLONE = URLRoot() & "db/" & Dbid() & "?a=er&dfid=31&rid=" & ;
      var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=dbpage&pagename=" & URLEncode("Service Request Form.html") & "&clist=a&rid=" & ;
      var text URLTHREE = "https://vcommerce.quickbase.com/db/bnhjmd73w?";
      var text URLFOUR = $URLONE & "&NextURL=" & URLEncode($ViewOnFormThirtyOne);
      var text style = "style=\"text-decoration: none; background:" & $bgcolor & "; border-radius: 5px; padding: 10px 24px; margin-bottom:5px; width: auto; font-weight: normal; font-size: 12px; text-align: center; display: inline-block; color: " & $txtcolor & "; font: normal 700 24px/1 \"Calibri\", sans-serif;";
      // End button style


      "<div>" &
      "<a " & $style & " href='" & $URLFOUR &"'>Update Info</a>" & "&nbsp;&nbsp;" &
      "<a " & $style & " href='" & $URLTWO &"' target=\"new\">Print Record</a>" & "&nbsp;&nbsp;" &
      "<a " & $style & " onclick='DoSaveAdd()'href='#'>Save Changes</a>" & "&nbsp;&nbsp;
    • JanaBaker's avatar
      JanaBaker
      Qrew Cadet
      Kelly this is amazing!  I wont lie, some/most is over my head but i can piece it together.  I'd love to mimic this if possible, but think i need a little hand holding if you dont mind?

      To make sure i get it it, all of this code makes all four buttons your reference at the beginning of the post! My needs fairly close.

      Upon saving, i want the user to return to Report 27 when sitting for Form 16. Currently they are being forced back to the original form, and i dont want that.  How can i that into your code?  I have little bits working but not all.  This redirects the user to report 27: 

      URLRoot()  & "db/" & [_DBID_LEADERS2] & "?a=q&qid=27&nv=1&v0=" & [Record ID#];

      Your URLTWO goes to Service Request, mine would go to the "A-Team Dashboard"...what would i put in place of what you have here:  URLEncode("Service Request Form.html"?

      Then URLTHREE would just be my QB App i would assume?  And for other changes i would need to make...where you have Form 31, i put what form # the buttons are sitting on?  So Form 16 in this example and use [Record ID#] vs. ?

      Thank you in advance!!