Skip to main content
Question

Save button with a redirect

  • May 18, 2017
  • 0 replies
  • 925 views

I haven't found a thread yet with a solution that is working with me so, I am trying to to make a button that saves and redirects. Currently I am trying 

<div class='Vibrant Success' onclick='RedirectURL.value=myurlhere;editform.rl.value="";DoSave();'>Save</div>

I got my current setup from this thread https://community.quickbase.com/quickbase/topics/how-can-i-save-and-redirect-to-a-home-page 

This thread is the closest thing to what I am looking for. I would like to be able to save a form and then be redirected to a different table and its default report. Is there an easier solution? 

Yes,

I'm just on my iPhone now, but you can use this contract.

var text URLONE =. Insert your first URL here ;
var text URLTWO =. Insert your next URL here ;

$URLONE
& "&rdr=" & URLEncode(NextURL )

The first URL would be the one where you are using GenAddRecordForm

  • Author
  • Quickbase Alumni
  • May 18, 2017
var Text URLONE =. https://example.quickbase.com/1 ;

var Text URLTWO =. https://example.quickbase.com/2 ;

$URLONE 
& "&rdr=" & URLEncode(NextURL )

Is telling me variable declaration must end with a semi colon

If you post hour formula I can hep correct it.  But you need to end each of the two formula variable lines with a semi colon.

var Text URLONE ="https://example.quickbase.com/1";

var Text URLTWO ="https://example.quickbase.com/2";

$URLONE 
& "&rdr=" & URLEncode($NextURL )

Also I had an error on the last line.

  • Author
  • Quickbase Alumni
  • May 18, 2017
Ahhh yes, I forgot the quotation marks, silly mistake on my part. 

Currently the formula is:

var Text URLONE ="https://clearpath.quickbase.com/db/bmr3y249a?a=nwr";

var Text URLTWO ="https://clearpath.quickbase.com/db/bmr3y225t?a=td";

$URLONE 
& "&rdr=" & URLEncode(NextURL)

I too am getting an error on the last line

Right, so I corrected that in my previous post. Needs to be $NextURL.



& "&rdr=" & URLEncode($NextURL)

  • Author
  • Quickbase Alumni
  • May 18, 2017
This did the trick, thank you! 

Great, thx for letting me know.

  • Quickbase Alumni
  • September 10, 2018
Is there a way to do this without getting the QB prompt: 

"You've made changes to this Service Request. Do you want to save these changes before going to the next screen?"

I'd like it to just save the record and redirect, is there a way to skip the "are you sure" part? 

Try going to the Table 
Advanced Settings
and check the box for :  Save parent record automatically when a child record is created.


  • Quickbase Alumni
  • September 10, 2018
Worked perfectly! Thank you! 

  • Quickbase Alumni
  • September 14, 2018
Hey Mark,

I'm trying to set this up to send me to a certain report (within the same table) once I click the save button in a form. Is this possible?

I've set up the following in a Formula URL field and placed the button in the form:

var Text URLONE ="[my data entry form URL]";
var Text URLTWO ="[my report URL]";
$URLONE 
& "&NextURL=" & URLEncode($URLTWO) 

But, it's only saving and keeping me in the same form, opened to the next new record.

It should work.  Can you post your complete code?  You can disguise any company specific info if you need to.

  • Quickbase Alumni
  • September 14, 2018
var Text URLONE ="https://tltransportation.quickbase.com/db/bm3qmxh8k?a=nwr";

var Text URLTWO ="https://tltransportation.quickbase.com/db/bm3qmxh8k?a=q&qid=22";

$URLONE 
& "&NextURL=" & URLEncode($URLTWO)

It really should work

Maybe try  this

var Text URLONE ="https://tltransportation.quickbase.com/db/bm3qmxh8k<b alt="" title="" name="" value="" type="" target="" rel="">?act=API_GenAddRecordForm</b>;

var Text URLTWO ="https://tltransportation.quickbase.com/db/bm3qmxh8k?a=q&qid=22";

$URLONE 
& "&NextURL=" & URLEncode($URLTWO)

  • Quickbase Alumni
  • September 14, 2018
Thanks! I'm getting this error back though 

something got messed up on my post by this forum when i tried to bold the change.

try this for the first formula variable.


var Text URLONE ="https://tltransportation.quickbase.com/db/bm3qmxh8k?act=API_GenAddRecordForm";

  • Quickbase Alumni
  • September 14, 2018
Strange, it is opening a new record in a separate tab while leaving the original record open and unsaved. 

The checkbox on the URL formula field should not be set to open in a new tab.

But let me be sure I understand what your workflow is.  Your are supposed to have this button on the report.  You click the button and a blank form should open.  You then save the record normally and it should re-display the report.

  • Quickbase Alumni
  • September 14, 2018
Mark,

I unchecked the open in new tab box, and now it does save the record, closes it, and opens a new one in its place. That is an improvement! but not the one I was looking for. It also prompts me with this at every click, which would be tedious for users:



Any ideas around this prompt?

As for your request:

Current workflow: The user goes to Table X, clicks "Add New Record", fills out data in form, clicks "Save & close", user is shown the saved record (view mode).

Desired workflow: The user goes to Table X, clicks "Add New Record", fills out data in form, clicks "Save & close", user is shown a report called "Today's Records" that I've created. 

This way they can keep track of records already entered for the day

Thank you for your help so far!!

The intention is for this button to be on the report.  You would launch off the report.  There would be a column of identical buttons on the report.  The user would click any of the identical buttons to start the workflow. 

  • Quickbase Alumni
  • September 14, 2018
Ah I see now, it works perfectly, thanks for clearing that up!! I was placing it within the form itself.