I am trying to use SuiteScript to send some data from a sales order to an external web service. I have this working in the Script Debugger; I can pass a sales order internal ID to my function and see the correct actions taking place.
Now I want to hook this in to the NetSuite UI and I am unsure which Script Type to use. Ideally this function would be triggered when a custom button is pressed on a sales order form. The button press would start the function and pass in the internal ID of the current sales order. A status message returned from the function would be stored in a custom field on the form.
What is the best Script Type to use in this scenario? I looked at Workflows, but I don't see a way to trigger one manually with a button press. It appears that a SuiteLet may be the correct approach, but I am unclear about how I would trigger this from a button or link on the sales order form.
Any suggestions are appreciated.