Discussions

Expand all | Collapse all

Create a button that saves then redirects to a dashboard

  • 1.  Create a button that saves then redirects to a dashboard

    Posted 05-01-2017 21:31
    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?


  • 2.  RE: Create a button that saves then redirects to a dashboard

    Posted 05-01-2017 21:39
    This is the code that redirects to the dashboard

    "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid())


  • 3.  RE: Create a button that saves then redirects to a dashboard

    Posted 05-01-2017 22:16
    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:


  • 4.  RE: Create a button that saves then redirects to a dashboard

    Posted 05-04-2017 17:52
    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. 


  • 5.  RE: Create a button that saves then redirects to a dashboard

    Posted 05-04-2017 17:58
    change the 

    a=dbpage&

    to be

    a=showpage&

    that should fix the issue


  • 6.  RE: Create a button that saves then redirects to a dashboard

    Posted 05-05-2017 13:19
    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)


  • 7.  RE: Create a button that saves then redirects to a dashboard

    Posted 05-05-2017 13:24
     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?


  • 8.  RE: Create a button that saves then redirects to a dashboard

    Posted 05-05-2017 14:44
    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">https://ctc.quickbase.com/db/bmqu5ffji?a=showpage&pageid=87%5C%22%3EReturn">https://ctc.quickbase.com/db/bmqu5ffji?a=showpage&pageid=87\">Return To Dashboard</a>"


  • 9.  RE: Create a button that saves then redirects to a dashboard

    Posted 05-01-2017 22:16
    Let me know if that works for you or if you have any trouble. Good Luck!