<@UEUDUCPB4> We want to send the invoice field in ...
# suitescript
a
@_nikhilpalli We want to send the invoice field in suitelet paramter using client script 2.0
u
Do you want to do this when the person loads the page? or did you want to add a button and then send the field to a suitelet as a result of the button click?
a
yes, after button click I opened suitelet but unable to get invoice field value.
u
how did you add the button to the form?
with userevent?
a
yes\
s
Sounds like you need to call the suitelet with a parameter that you can get from the page within the UserEvent that you are adding the button?
a
yes
u
so you can add a client script to handle the click of the button
in your User Event you can add a button, reference a functionName in a client script, and then use clientScriptModulePath to add a client script to the form
Copy code
context.form.addButton({
    id: 'your_stlt_id',
    label: 'Stlt Name',
    functionName: 'open_suitelet'
});
                context.form.clientScriptModulePath = './pathToYourClientScript';
then in your client script, create a function called
open_suitelet
and grab the fields you need and use
url.ResolveScript
to create a url.
the one thing you have to know is so make sure you export
open_suitelet
a
Now I got the value, thanks @_nikhilpalli
u
sure thing
a
And, can you please let me know how I can get the country of customer on button click.
u
prob better to get customer id and search for it in suitelt