How to get formula URL field with JavaScript to run in IE 11? Worked fine until recently.

  • 1
  • 1
  • Question
  • Updated 3 years ago
  • Answered
We've had this code for a while in a formula URL field, and it doesn't seem to work anymore on IE 11 (we've tried turning off compatibility view, ensuring cookies are on, etc.).

I am not a javascript guy, but understand a little how it works, and am just not able to figure out how to get it to run properly in IE 11 (which our company just moved a bunch of users to).  It opens a window and says the page cannot be displayed, when it used to just run the script, create the new record, and return to the page.

Any thoughts?





var text a= URLRoot() & "db/bjhhe43qz" & "?act=API_AddRecord" &



[then all the fields we are writing to in that new record]

& "&apptoken=_________________"& "&rdr=" &
Dbid() & "?a=er&rid=" & URLEncode ([Record ID])

;

"javascript:" &

"$.get('" &

$a &

"',function(){" &

"location.reload(true);" &

"});"

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


Photo of breakweather

breakweather

  • 40 Points

Posted 3 years ago

  • 1
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,944 Points 50k badge 2x thumb
I'm surprised that that ever worked in any browser.

Try this



var text URLONE = URLRoot() & "db/bjhhe43qz" & "?act=API_AddRecord" &



[then all the fields we are writing to in that new record]

& "&apptoken=_________________";



var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & URLEncode ([Record ID]);

$URLONE

& "&rdr=" & URLEncode($URLTWO)




Photo of breakweather

breakweather

  • 40 Points
Thanks for the quick response, Mark.  So, to be clear, I don't need the additional language from "javascript" through "void(0)"?  Your solution above is obviously quite a bit simpler.

We have a separate URL formula field that strings together several of the above URL formula fields to create a series of actions (like create records in table A, then create records in table B, then in table C, etc.) all from one button, which was handy for our users.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,944 Points 50k badge 2x thumb
As far as I know, when you use that javascript refresh method its really nice because it just refreshes the page you are on, be it a record or a report. However, I have never got it to work when there are "redirects" involved  "&rdr="'

so then you need to  list each nested action including the last one to refresh to the record or a specific report.

So, yes, just that code above.