Forum Discussion

NarayananKumbak's avatar
NarayananKumbak
Qrew Cadet
5 years ago

Previously working JAVA Scripts do not work anymore

Does anyone experience the issue of buttons that run JAVA Scripts to create/update records do not work? The buttons were working until August 8th and stopped working since August 9th.

15 Replies

  • Hi NK23,

    Unfortunately, this kind of issue can crop up with Javascripted buttons, if they are interacting with areas of the product that are changing this can cause them to break or have unusual behavior since they aren't directly supported. What exactly are you using the button to do? It is possible that what you have currently could be transitioned into a button that triggers a code page with the help of some of the Community experts or possible replaced with some native functionality. 
  • Thanks for the response. The button is programmed to call a JAVA Script code page (.js) to gather records from one table, process it and upload the results in another table.

    • hhersch's avatar
      hhersch
      Qrew Captain
      What is the formula of the button? Have you debugged your JavaScript page to see what the error is?
  • I have the same problem. JavaScript button was working in Chrome, now fails.  It DOES still work using Edge. Similar to original poster, my button calls a .js page, which does some calculations, then updates a record. It isn't complex. I'm not an adept javascript user, but my simple debugging techniques (an alert inside the code) indicate the page isn't loading at all. Chrome settings allow JavaScript, and pop ups.
    • hhersch's avatar
      hhersch
      Qrew Captain
      What is the formula of your button (minus anything confidential)?
    • AndreaBest's avatar
      AndreaBest
      Qrew Trainee
      javascript:" &
      "var qb_rid=" & [Record ID#] & ";" &
      "var qb_maxnum=" & [Maximum Appts] & ";" &
      "$.getScript('" & URLRoot() & "db/bjxxxxxx?act=dbpage&pagename=ProduceNumbers.js');void(0);"
    • NarayananKumbak's avatar
      NarayananKumbak
      Qrew Cadet
      I also have a very similar formula. I am using Chrome version 76.0.3809.100 and script doesn't run. My colleague has an older version of the Chrome and it runs perfectly well on Chrome version 66.0.3359.139
  • This reply was created from a merged topic originally titled Calling Multiple URLS with a Javascript Formula Button - used to work, now broken....

    For the better part of the last year we've been using a formula button with javascript to call two URLs at once, then reload the page.

    One URL sends a text message (via webhook to an external system), while the other edits a record in our database to log the action (the variables $sendText and $logText below, respectively).
    "javascript:" &
    "$.get('" &  $logText &  "');" &
    "$.get('" &  $sendText &  "',function(){" & "location.reload(true);" & "});" &
    "void(0);"
    Up until about a week ago this technique worked with virtually no issues but now it just opens a blank page and does nothing else.

    I have tested the two individual URLs by putting them into their own buttons, and they continue to work fine, which leads me to think there is something wrong with our Javascript. I suspect it may be relying on assumptions about Quickbase or the page structure which are no longer true with the latest update. Any ideas?

    Thanks in advance!
    Jonathan
    • hhersch's avatar
      hhersch
      Qrew Captain
      Specifically on this implementation, what is the reason for using JavaScript instead of just formula URLs?
    • QuickBaseCoachD's avatar
      QuickBaseCoachD
      Qrew Captain
      The reason for the JavaScript is that it will refresh whatever page regardless of whether it�s a record or any report.

      When you use the method with the nested URLs, the last step has to display either the record or a particular report. So it�s a bit annoying to have to have different versions of the formula URL depending if you are putting the button on a record or a report or an embedded child table on a parent record.
    • JonathanGibson's avatar
      JonathanGibson
      Qrew Trainee
      This is one reason; the other is that employing the nested URLs method in our case causes an unwanted new tab/window to pop open displaying the results of the webhook, and the current tab/window loses focus. Which sounds like a small annoyance, but it's actually pretty significant when we have a large of number of records to batch process this way on a daily basis.
  • hhersch's avatar
    hhersch
    Qrew Captain
    Hi all. We are unaware of anything we changed that would have impacted this. As Evan mentioned, this is an unsupported technique that we cannot regression test for. That being said, I'd love to learn what the use case is if I can replicate the issue. Would anyone be willing to invite me into the app (hhersch@quickbase.com) and send me a link to a test record?

  • I have a support case opened for this issue. case #598685. I can provide access to my App through the support case record.

  • For what its worth, 
    tldr: I changed the definition of the QuickBase button, unchecking the "open target in a new window", and now the button works for me.

    Longer: Chrome version 76.0.3809.100 did change behavior. I didn't understand most of what the change talked about. It did cover issues regarding opening a new window, copying context, and queueing up clicks. Chrome folks said the changed behavior is the correct behavior, and will not be changing it back. For my application, I did not need or want a new window opened. I was surprised to see the checkbox for my button filled in to open a new window.  It was worth experimenting to remove the check, and looks like that solved the problem for me.  

    Good luck all, hope you find solutions that fit your applications.
  • This worked for me as well, at least in Chrome. Funny because I distinctly remember having to check that box in order to make the button work back when I first created it, so yes it looks like the Chrome update was the culprit here.

    Thanks to everyone who helped out with this!