I'm struggling trying to find how to call a javascript function inside a button to get the current url, then use this current url in my API_EditRecord button...I fell I'm super close, just not invoking the script properly...any help would be great!!
//----------------------------------JS which properly returns the url:-------------------------------------------------------------------
(function(){
var querystring=window.location.href;
alert(querystring);
})();
//-----------------------------------------------------------------------------------------Button code below--------------------------------------------
If([Status]="In Inventory/Idle",
var text javavariable =
"javascript:" &
"$.get(function(){" &
"window.location.href;" &
"})();"
;
var text URL =
URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
"&rid=" & [Record ID#] &
"&apptoken=3zjjxcfi6gmacdiekickzax92" &
"&_fid_14=In Use" & //Set Status to Being used. This will fire automation to create an Event.
"&_fid_20=javavariable" & //Get the variable from Java
"&rdr=" &
URLEncode(URLRoot() & "db/" & Dbid() &
"?a=dr&rid=" & [Record ID#])
;
"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"
, "")
------------------------------
Jeremy Myer
------------------------------
Question
javascript to use return value from javascript
This topic has been closed for replies.
Sign up
Already have an account? Login
Login to the community
Login with Quickbase US – quickbase.com Login with Quickbase EU – quickbase.eu
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.