Discussions
SuiteWorld is where the NetSuite community comes together to learn, connect, and discover what’s next.
Whether you’re looking for product updates, practical tips, new ways to improve efficiency, or insights from other customers, SuiteWorld offers something for every stage of your NetSuite journey.
■ NetSuite 2026.2 Release Notes
■ NetSuite SuiteApps Release Notes
■ NetSuite Sneak Peeks
■ Release Preview Guide
■ Release Preview Test Plan Template
nlapiSendEmail sending two copies of attachments
Hi,
I have a script that is automatically sending an email to a custom record in our system.
The (simplified) script is shown below
function afterSubmitPartnerApplication(type){
if (type != 'delete') {
var id = nlapiGetRecordId();
var type = nlapiGetRecordType();
var notification = nlapiGetFieldValue('custrecord_notificationsent');
if (notification == 'F') {
var status = nlapiGetFieldValue('custrecord_applicationstatus');
var name = nlapiGetFieldValue('custrecord_firstname') + ' ' + nlapiGetFieldValue('custrecord_lastname');
var hruser = '15386';
var emailRecords = new Object();
emailRecords['recordtype'] = 'customrecord_partnerapplication';
emailRecords['record'] = id;
var emailFields = new Object();
var attachments = new Array();
emailFields['NLFULLNAME'] = name;
var user = hruser;
var email = nlapiGetFieldValue('custrecord_emailaddress');
if (status == '13') {
var template = '105';