I would like to create a url button that redirects to the original location the record was opened from

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • In Progress
I would like to create a url button that saves field values and then redirects to the original location the record was opened from, This is the code currently on the Button it redirects to the homepage. I want to redirect to the origin where the record was opened from

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=##########" &
    "&_fid_16=COMPLETED" &
    "&_fid_13= " & Today() 
&  "&rdr=" &
    URLEncode(URLRoot() & "db/" & Dbid())
Photo of zvi bock

zvi bock

  • 200 Points 100 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Matthew Neil

Matthew Neil

  • 31,438 Points 20k badge 2x thumb
You will have to have a button that they push (rather than the default pencil or eye ball buttons).

Within that button you will want to use the function "nextURL="  rather than using an RDR.
Photo of zvi bock

zvi bock

  • 200 Points 100 badge 2x thumb
What would I set the nextURL to be. Users can  access the record from multiple locations when they hit the button I want some fields changed, the record closed and the user returned to location of origin
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,346 Points 50k badge 2x thumb
They this

URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=##########" &
"&_fid_16=COMPLETED" &
"&_fid_13= " & Today()
& "&z=" & Rurl()
Photo of zvi bock

zvi bock

  • 200 Points 100 badge 2x thumb
As per http://www.quickbase.com/developer/articles/using-zrurl-and-rdr-formula-url-fields  "&z=" & Rurl() does not work for a=API_EditRecord. Also I may be mistaken but it seems that even if it did work it would bring me back to the same record I was on when pressing the button. In my case I want it to return me to the previous page, the one I was on before opening the record - as if I pressed save and close
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 51,346 Points 50k badge 2x thumb
Sorry, I don't know of a different answer than Matthews, but I suppose that you can make a bunch of different buttons each with a different &NextURL suffix.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,522 Points 20k badge 2x thumb
APIs that return XML, JSON or other data interchange formats are not really designed to have their URLs loaded as new pages except perhaps in diagnostic situations as their response are not generally considered to be human readable. This of course applies to a=API_EditRecord (which returns XML) as well as the vast majority of methods in QuickBase's HTTP API.  When this is done the common convention among QuickBase users is to redirect away from the XML response by using an rdr parameter. This is a hack from the 90s. You should be using script instead of rdr parameters to control what happens next after calling your primary API. After the API is executed under script control you can redirect to any page you want or chain other processing or API calls into the workflow.

Continuing to use rdr parameters and other crude redirection schemes will continue to hold back QuickBase's progress.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,522 Points 20k badge 2x thumb
I was drafting when a comment came in so I continue here:

Continuing to use rdr parameters and other crude redirection schemes will continue to hold back QuickBase's progress. In fact, the widespread introduction of redirection into formula URLs is probably one of the reason QuickBase did a reboot of their development plans. Using page redirection in formulas is preventing QuickBase from adopting a more modern "single page application" architecture.
(Edited)