Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
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"});
Refer a Member to the Community | Earn the Answer Accepter Badge | Vote for the contents you'd like to see
