KenCasser
7 years agoQrew Cadet
Two API Calls in a Row
I'm trying to run consecutive API calls, (no tokens), and it's not working. Each call works fine separately, but when run together, the first one executes but the second one is ignored. If I swap $URLTWO with $URLONE, $URLTWO executes but not $URLONE. My code is below:
var text bgcolor = "red";
var text txtcolor = "black";
var text URLONE = "https://myqb/db/mydbid?act=API_EditRecord&rid="&[Record ID#] & "&_fid_215="&[SalesOrderNum];
var text URLTWO = "https://myqb/db/mydbid?act=API_SetDBVar&varname=SalesOrderNum&value=&q...;
"<a style=\"text-decoration: none; width:200px; background:" & $bgcolor & "; height: 30px; color:" & $txtcolor & "; padding: 7px 10px; display: inline-block; text-align: center;\" href=\"javascript:" & "$.get('" & $URLONE & "&rdr=" & URLEncode($URLTWO) &
"', function(){" & "location.reload();" & "});" &
"void(0);\">SONumber?</a>"
[SalesOrderNum] is an app variable. I've tried this with and without the "&rdr=", same result.
Thank you!
var text bgcolor = "red";
var text txtcolor = "black";
var text URLONE = "https://myqb/db/mydbid?act=API_EditRecord&rid="&[Record ID#] & "&_fid_215="&[SalesOrderNum];
var text URLTWO = "https://myqb/db/mydbid?act=API_SetDBVar&varname=SalesOrderNum&value=&q...;
"<a style=\"text-decoration: none; width:200px; background:" & $bgcolor & "; height: 30px; color:" & $txtcolor & "; padding: 7px 10px; display: inline-block; text-align: center;\" href=\"javascript:" & "$.get('" & $URLONE & "&rdr=" & URLEncode($URLTWO) &
"', function(){" & "location.reload();" & "});" &
"void(0);\">SONumber?</a>"
[SalesOrderNum] is an app variable. I've tried this with and without the "&rdr=", same result.
Thank you!