RE: Post a Suilet from button click
I have a button on the item record. When clicked, it should open a suitelet in a new window. I have to pass a JSON object as a parameter to the suitelet. So, when using GET, it fails as the URL exceeds the limit. Can anyone tell me how to call a Suitelet using POST and send the parameters (JSON object) from a button click in the client script.
Usually it helps if you share the code you’ve got so far and what you’ve already tried, as well as any errors you’re encountering.
In general, your Client Script will resolve the URL of the Suitelet with N/url and send the POST request using N/https. The parameter that gets passed in to the Suitelet entry point method contains an N/https.ServerRequest which has a method property telling you which type of request you’ve received. You can use this to determine how the Suitelet should respond based on request type.
See the NetSuite Help docs on the Suitelet’s onRequest entry point for details.