Discussions
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. Join us
NSC | SuiteScript: Send Saved Search Results in a tabular form via email using HTML
Scenario
The user wants to send the results of a saved search via email body using a simple HTML table.
Solution
/**
* @NApiVersion 2.x
* @NScriptType ScheduledScript
* @NModuleScope SameAccount
*/
define(["N/file","N/search","N/email"],
function(file, search, email) {
/**
* Definition of the Scheduled script trigger point.
*
* @param {Object} scriptContext
* @param {string} scriptContext.type - The context in which the script is executed. It is one of the values from the scriptContext.InvocationType enum.
* @Since 2015.2
*/
function execute(scriptContext) {
var columns = new Array();
var htmlString = '';
columns[0] = search.createColumn({name: "internalid", label: "Internal ID"});
columns[1] = search.createColumn({name: "item", label: "Item"});
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
