I’m trying to get a Suitelet to POST to another Su...
# suitescript
j
I’m trying to get a Suitelet to POST to another Suitelet, but POST into a new tab/window not the same one. Is this possible? It needs to POST data from the first Suitelet’s form.
w
Could you perhaps create a custom button on the suitelet that you bind to a client function that makes the http-call with the values from the form?
j
I don’t know how to get and pass on the data though
I can get the data and submit to self
I can open new window
but I need some combination
b
make your own button
change its formaction to your second suitelet
j
change its formaction to your second suitelet
I’m not sure what you mean
b
j
oh I thought you meant it was a netsuite thing
I’m still not sure how I would make anything open in a different window
b
formtarget
probably want to go though that button page in its entirety
j
so when you say “make your own button” you mean make one in HTML.
b
correct
theoretically you can modify an existing button, but you might as well make a new button if you arent making it behave like native buttons
you can probably modify the html form, but thats more intrusive than the button
j
So make a button that will submit the form, but have the button change the formaction and formtarget so that the form submits to a new window with the specified URL.
b
you choose your own action and target for your button
kinda concerned about all the change stuff unless you plan on modifying an existing button with code
j
I have a module already for making buttons that look like NS buttons
if needed at least there’s only one place I’ll have to update/make changes
suitelet I’m submitting to isn’t receiving any data. I’m going to have to do this a different way.
b
whats the html for your button look like?
j
Copy code
<input type="submit" id="test_button" name="test_button" class="rndbuttoninpt bntBgT" value="Test XML" formaction="/path/to/my/suitelet" formtarget="_blank" onmousedown="this.setAttribute('_mousedown','T'); setButtonDown(true, false, this);" onmouseup="this.setAttribute('_mousedown','F'); setButtonDown(false, false, this);" onmouseout="if(this.getAttribute('_mousedown')=='T') setButtonDown(false, false, this);" onmouseover="if(this.getAttribute('_mousedown')=='T') setButtonDown(true, false, this);" _mousedown="F">
[aside: I hate how NetSuite assumes I’d only want to click this button once….the whole point is that I want to be able to click it again and again opening new tabs]
b
is this button inside the form?
j
yes
I think there is some flaw in my logic for checking the submitted data
as I tried just submitting as normal and there’s still nothing in
context.request.parameters
wait
there’s a chance I’m an idiot
confirmed, am idiot
all right, the above part is working EXCEPT for the fact that I get “You have already submitted this form.” everytime thereafter
need to put something in to undo that
done
THANK YOU for your help!