Discussions
Read on for the latest updates including:
• Agenda Builder launch
• SuiteWorld On Air registration
• New NetSuite Prompt Studio Contest
• And more!
Check out this thread to learn more!
Don’t miss your chance to meet our SuiteGurus—NetSuite Support professionals and subject matter experts with extensive experience in select product areas, including OneWorld, Advanced & Basic Accounting, Supply Chain Management, Receivables & Payables, CRM, Account Administration, and the SuiteCloud Platform. Full Conference attendees can prebook exclusive 30-minute one-on-one sessions for your product questions.
Spots are limited! Register through your Agenda Builder and find SuiteGuru under Agenda Enhancements.
Create a CSV file, save, load and parse the CSV contents using suiteScript
This sample calculates the total for the second column value in a CSV file.
Each line in the CSV file has the following format:
date,amount
Here is the sample data that the script adds to the file:
10/21/14,200.0
10/21/15,210.2
10/21/16,250.3
Code Below:
require(['N/file', 'N/error', 'N/log'], function (file, error, log) {
// Create the CSV file
var csvFile = file.create({
name: 'data.csv',
contents: 'date,amount\n',
folder: 39,
fileType: 'CSV'
});
// Add the data
csvFile.appendLine({
value: '10/21/14,200.0'
});
csvFile.appendLine({
value: '10/21/15,210.2'
});
csvFile.appendLine({
value: '10/21/16,250.3'
});
// Save the file
var csvFileId = csvFile.save();
// Create a variable to store the calculated total