Anyone seen this before or know of a solution? I ...
# suitescript
j
Anyone seen this before or know of a solution? I have multiple buttons on a form. When clicked, they trigger a suitelet with several parameters passed along to the suitelet. One of the parameters is a hardcoded value (hardcoded into the field value itself). For one of the buttons, when I click on it, the URL is returning all of the parameters from a different button. I've used dev tools to confirm the data is correct but it's just returning wrong data on the suitelet that pops up. This is how each button is configured (inline HTML). The button=2 or button=3 is the hardcoded piece of data. When I click either one, it returns the suitelet with the button=3 data.
Copy code
<button id="custrecord_up_license"> <a href="#" onclick="openSuitelet()">Click here to upload license.</a></button><script>function openSuitelet() {window.open("/app/site/hosting/scriptlet.nl?script=718&deploy=1&internalid=122&custname=10191 Tropical Sunshine Agency – USE only for Training – EXP – PROD&docnum=BQ122&button=2", "popup", "width=320, height=320"); return false;}</script>
Copy code
<button id="custrecord_gl_ins_document"> <a href="#" onclick="openSuitelet()">Click here to upload.</a></button><script>function openSuitelet() {window.open("/app/site/hosting/scriptlet.nl?script=718&deploy=1&button=3&internalid=122&custname=10191 Tropical Sunshine Agency – USE only for Training – EXP – PROD&docnum=BQ122", "popup", "width=320, height=320"); return false;}</script>
j
you’ve defined the two functions with the same name
it doesn’t know which one to call
j
That was it - thank you! This was my first time separating out the function from the onclick so I hadn't thought about that.
Appreciate the help!
j
np 🙂