Forum Discussion

SamKrausz's avatar
SamKrausz
Qrew Cadet
7 years ago

Change the Redirection

How can I avoid that it should not open a new page while running the following code?

I just want to refresh the current page 


--------------------------------------------------------------


var text NewToggle = If([Active]="Yes","No","Yes");


var text URLone = URLRoot() & "db/" & Dbid()  & "?act=API_EditRecord&rid=" & [Record ID#]
& "&_fid_20=" & $NewToggle;

var text URLtwo = URLRoot() & "db/" & [_DBID_SUPPLIERS] & "?act=API_RunImport&ID=10";



$URLONE
& "&rdr=" & URLEncode($URLTWO)
  • It is opening the response to the Import-variable because you do not have anywhere else for Quick Base to redirect to, so you need a third variable to redirect Quick Base to a different place after running the API_RunImport variable.

    var text URLThree=URLRoot() & "db/" & Dbid() & "?a=dr&rid="&[Record ID#]

    Then your url will be:

    $URLOne & "&rdr=" &
    URLEncode($URLTwo & "&rdr=") &
    URLEncode(URLEncode($URLThree))

    Note - if your table has a custom Key field; then your &rid="&[Record ID#] should be &key="&[Userid] instead