Skip to main content
Question

javascript to use return value from javascript

  • August 20, 2020
  • 0 replies
  • 28 views

Forum|alt.badge.img+3
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
------------------------------
This topic has been closed for replies.