Forum Discussion
JonathanGibson
6 years agoQrew Trainee
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).
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
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:" &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.
"$.get('" & $logText & "');" &
"$.get('" & $sendText & "',function(){" & "location.reload(true);" & "});" &
"void(0);"
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
- hhersch6 years agoQuickbase StaffSpecifically on this implementation, what is the reason for using JavaScript instead of just formula URLs?
- QuickBaseCoachD6 years agoQrew CaptainThe 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. - JonathanGibson6 years agoQrew TraineeThis 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.