How to create a save button to save a new record and then redirect to outside URL

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered
I am wanting to replace the default green "Save" button with a button that will save the new record and then redirect the user to a URL outside QB. I'm sure this is not that difficult, but I am stumped. 
Photo of ROBERT VALENTINE

ROBERT VALENTINE

  • 152 Points 100 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
Photo of Paul Vorster

Paul Vorster

  • 546 Points 500 badge 2x thumb
Hi Robert, I am also interested in this solution, as we use it for our mobile app, at this point we haven't gotten it right yet, but will keep you posted.
Photo of ROBERT VALENTINE

ROBERT VALENTINE

  • 152 Points 100 badge 2x thumb
Hi Paul!

I found this on the QB Exchange (Magic Buttons) and it works perfectly for what I'm wanting to do.


"<a  class='Vibrant Success' href='javascript:LinkAway(\"" & "https://www.destinationswebpage.com"; & "\");' >Submit & redirect</a>"


// This works because you have turned on the table's advance settings, "Save parent record automatically when a child record is created."
// This also is borrowing the LinkAway that gets automatically added for formula url fields.  We are invoking it here so when we are directed to the success.html page the record is first saved.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,352 Points 20k badge 2x thumb
See this demo which (1) submits the form using  fetch API and FormData and (2) redirects to the FormData info page at MDN:

Save & Go ~ Add New Favorite Mathematician

https://haversineconsulting.quickbase.com/db/bnsthzcid?a=nwr

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=667

(Edited)