I created a custom button and used `form.requestSu...
# suitescript
r
I created a custom button and used
form.requestSubmit()
to submit the form, so it can hit POST in my SuiteLet, only now I'm getting weird behavior where I can click the regular submit button and it will submit both lists. Same with the custom button. I need to prevent users from clicking the wrong button and/or checking the wrong list, but I can't seem to identify from POST which button was used.
e
I create a hidden text field on the form, and when any of the custom buttons are clicked, they populate the hidden field with an appropriate identifier that I can then use in the
POST
handler. If it's empty, the main Submit was clicked.
m
The entire Suitelet is a single form so whether you click the native submit button, or have a client script call
request.submitForm()
, the whole thing is submitted. You could have a hidden field and set a value in that right before your custom button calls
submitForm()
then your suitelet checks the value of that field.
r
brilliant, thanks
I was already preventing submitting from both lists, and warning about not making selections. This will prevent the user error.
crushed this project. thanks
❤️ 1