Hello, I am new to SuiteScript and need help with ...
# suitescript
e
Hello, I am new to SuiteScript and need help with running my Suitelet when a custom button created from a User Event script is clicked. When I click on the custom button nothing happens. My Suitelet is a simple script that uses the N/render module to generate an XML file and if I click on the Suitelet URL from the Script Deployment page I am able to open the link just fine. How do I get the Suitelet to open when the custom button is clicked?
s
Typically your button calls a function sitting on a client script attached to the form/page. The client script calls the URL of the suitelet, is this the approach you have taken?
e
@Sandii I used clientScriptFileId on my UE script to call the client script from File Cabinet. Then my client script has a function to call the URL of the suitelet using url.resolveScript
s
url.resolveScript gets the url of the suitelet, it does not call it
there is an undocumented method called
nlOpenWindow()
that you can pass the url, or you could also use something standard like window.open
e
@Sandii got it! Thank you!