Hi all, I want to add 'My Close' button in Sales O...
# suitescript
d
Hi all, I want to add 'My Close' button in Sales Order ( SO ) , and when user clicks on that button, i want to open pop up window which contain textarea where user can input Reason, then click on Submit button. Upon clicking on submit button, i want to process to close the SO and update reason to custbody in SO, then the popup will auto close Currently I have User event to add 'My close' button, which will call client script to do window.open(suitelet). There is form in the suitelet with textarea and submit button. When user click on the Submit button, i don't know how should call window.close() to close the popup I'm not sure if i'm going to the right direction, or maybe any better approach to do this ? Please help Thanks
b
you want a normal button on the suitelet instead of a submit button
alternatively you have your suitelet return a page that simply closes itself
d
don't really get what you mean on
suitelet return a page that simply closes itself
can you elaborate more @battk
b
the primary way to close a window is to use window.close()
its most easily done through a button function
but you can also go the long way around and submit a post to the suitelet
and either write your own html page in the response from the suitelet that has the script you want
or return a form with an inline html field with the script you want
or return a form with a client script with the script you want
all 3 options involving using a submit button are honestly bad options that involve you adding a submit when you didnt really need it
d
ok so basically you suggest to use somethign like this
Copy code
form.addButton({
                id: 'buttonid',
                label: 'Submit',
                functionName: 'processClose(' + soID + ')'
                 });
then do the window.close() in processClose function in client script ?
b
yes
d
ic, ok @battk will try on that, thanks
but btw how do i pass the Textarea value which will be inputed by user to the client script ?
b