Forum Discussion

BiffStockdale's avatar
BiffStockdale
Qrew Trainee
5 years ago

Javascript - Delayed load of dynamic URL

I have been utilizing techniques found in various threads ( thanks Mark Schnier, Joshua Tate, and Xavier Fan ) in formula URLs.

I have successfully used code chunks that process "$URL" and then load to a different location and also instances where the Formula URL does it thing then reloads the same page after a delay.

However, I cannot seem to marry these two approaches.  I would like to have a delay and then load to a specific dynamic URL.

Below in bold is my failed attempt at marrying the delayed reload and reload to specific page using a dynamic URL.  This code is not working.

var text URL =
URLRoot() & "db/" & [_DBID_TABLE_6] & "?act=API_EditRecord&rid=" & [Record ID#]
& "&usertoken=xxxxxxx"
& "&apptoken=xxxxxxxx"
& "&_fid_106="& true
& "&_fid_129="& true
& "&_fid_97="& "PreExisting Network connection was accepted" & " at " & ToText(Now()) & " by " & UserToName(User());

var text URLNet =
URLRoot() & "db/" & [_DBID_TABLE_8] & "?a=er&dfid=10&rid=" & [PC Number - Network ID - Record ID#];

"javascript:" &
"$.get('" &
$URL &
"',function(){" &

"setTimeout(()=> location.href="&  $URLNet &  "(true),5000)  " &

"});"
& "void(0);"


I would appreciate any help in getting $URLNet to load after a delay after $URL finishes.


Thank you!!



1 Reply

  • I'm not sure how to do this in the more QB Formula notation... but with you using JS $.get('$URL')... the formula field might take a .then() after that which is a standard JQuery/newer JS notation.