Generating CSV from a single SO via script
I’m a bit new to scripting but I have some NetSuite experience. Right now, I’m being required by the company to automate a process prior our go live in 2 weeks.
I need to be able to automatically send a CSV file based on a sales order to a specific recipient.
I was able to create a scheduled script (suitescript 1.0) that loads an existing saved search (nlapisearchrecord) and then generate a CSV file from it (nlapicreatefile). From there, I then had the script to send the CSV file as an attachment to a specific recipient (nlapisendemail). The problem with this is that it creates a single CSV file for multiple sales orders.
I think I’d need to generate the CSV file on an after submit function but I’m not sure how to do it. Also, the script I created pretty much came from SuiteAnswers and unfortunately I cannot find anything there regarding CSV emails via user events.
Hopefully someone can help me with this. Thanks!