Create a button that saves then redirects to a dashboard

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
Hey guys, I need to create a button that saves and then redirects to a dashboard,

here is the code for the current button,

"<a class=\"Vibrant Primary\" href=\"https://ctc.quickbase.com/db/bmqu5ffji?a=showpage&pageid=87\">Return To Dashboard</a>"

But I need it to save before it redirects me. 

Any help?
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Mick Graham

Mick Graham

  • 330 Points 250 badge 2x thumb
This is the code that redirects to the dashboard

"&rdr=" & URLEncode(URLRoot() & "db/" & Dbid())
This is actually what you need right here: 
"<a  class='Vibrant Primary' href='javascript:LinkAway(\"" & URLRoot() & "db/" & Dbid() & "?a=dbpage&pageid=87" & "\");' >Return To Dashboard</a>"
You should also make sure this setting is turned on in the advanced settings for your table:
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
Hey Eric!

Sorry, I had to put this on the backburner for a bigger team project we had. I tried this but it gives me the error 

"Home pages cannot be viewed using this interface. Use act=ShowPage instead"

Any ideas?

The saving part worked, so that's good. 
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
change the 

a=dbpage&

to be

a=showpage&

that should fix the issue
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
No dice, now the button does nothing at all haha. I will keep tweaking and see what works, but if you have any ideas as to why, I'm all ears (no quickbase error message for the formula)
Photo of Manny De La Cruz

Manny De La Cruz

  • 940 Points 500 badge 2x thumb
 Correction, it works now, but only when the record is in edit mode, not in view mode. Any way to get the redirect to work in view mode? Or should I just make two buttons and have one appear in view mode and one in edit mode?
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
Correct, the linkaway function only works in edit or add.  So you are right you'll want to use your original href= button in view mode (and on reports).

"<a class=\"Vibrant Primary\" href=\"https://ctc.quickbase.com/db/bmqu5ffji?a=showpage&pageid=87\">Return To Dashboard</a>"
Let me know if that works for you or if you have any trouble. Good Luck!