UrsulaLl
8 years agoQrew Assistant Captain
Create URL formula that redirect and also calls a script
I need to create a button that will update a record and redirect back to the edit form, and at the same time, trigger a script to run in the background.
The orginal URL formula field states the following:
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&AppToken=XXXXX&rid=" & URLEncode ([Record ID#])& "&_fid_233=yes&_fid_254=" & Now() & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
Now, to add a call to a script page, I am at a loss. In most cases, I would do a separate button to call it, but it should only be called once on the page, and triggered when the button above is clicked. It makes sense then to add it to the same formula URL field. My initial thought was to just add it to the URL, but is not currently working. So I am not sure what to do next. Below is the text I need to add.
$.getScript('" & URLRoot() & "db/" &Dbid() & "?a=dbpage&pagename=PAGENAME.JS&rand='+Math.random())\"
The worst part is, I had this working a few weeks ago, and I cannot find my documentation for how I ended up getting it to work.
Any ideas would be appreciated, thanks!
The orginal URL formula field states the following:
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&AppToken=XXXXX&rid=" & URLEncode ([Record ID#])& "&_fid_233=yes&_fid_254=" & Now() & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#])
Now, to add a call to a script page, I am at a loss. In most cases, I would do a separate button to call it, but it should only be called once on the page, and triggered when the button above is clicked. It makes sense then to add it to the same formula URL field. My initial thought was to just add it to the URL, but is not currently working. So I am not sure what to do next. Below is the text I need to add.
$.getScript('" & URLRoot() & "db/" &Dbid() & "?a=dbpage&pagename=PAGENAME.JS&rand='+Math.random())\"
The worst part is, I had this working a few weeks ago, and I cannot find my documentation for how I ended up getting it to work.
Any ideas would be appreciated, thanks!