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!

Rookie Asked on October 22, 2020 in SuiteScript.
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor   Become a Sponsor