Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
NSC | Send an email with an attached CSV from a saved search result
Scenario
The user wants to extract the list of items that are pending fulfillment for all sales orders in a CSV file every week, and have the file sent to him and his team.
Solution
This is achievable in several ways including workflows, but in this example, we will be using a scheduled script. The script in the sample below provides all the steps including:
1. Creating and running the saved search
2. Adding the lines in a CSV string and saving it as a file
3. Sending the CSV file to several recipients
/**
* @NApiVersion 2.x
* @NScriptType ScheduledScript
* @NModuleScope SameAccount
Expand your NetSuite knowledge by joining this month's Ask A Guru Live: PROCURE TO PAY. RSVP on this event now!
Refer a Member to the Community | Earn the Answer Accepter Badge | Vote for the contents you'd like to see
