Mozsuite
09/25/2019, 8:26 AMbattk
09/25/2019, 8:54 AMMozsuite
09/25/2019, 9:00 AMquote = nRecord.load({ type:'estimate', id:quoteId });
customerId = quote.getValue({ fieldId:'entity' });
pdf = nRender.transaction({ entityId:quoteId, printMode:nRender.PrintMode.PDF });
email = nRender.mergeEmail({ templateId: templateId, transactionId: quoteId });
payNowUrl = getPayNowUrl(quote);
emailBody = email.body;
emailBody = emailBody.replace(PAYNOW_LINK_PLACEHOLDER, payNowUrl);
nEmail.send({
author:senderId,
recipients:[customerId],
subject:email.subject,
body:emailBody,
attachments: [pdf],
relatedRecords: {
transactionId: quoteId,
}
});
battk
09/25/2019, 9:35 AMbattk
09/25/2019, 9:35 AMbattk
09/25/2019, 9:35 AMrequire(["N/file", "N/email", "N/record", "N/render"], function(
file,
email,
record,
render
) {
var senderId = 3;
var quoteId = 703;
var quote = record.load({ type: "estimate", id: quoteId });
var customerId = quote.getValue({ fieldId: "entity" });
var pdf = render.transaction({
entityId: quoteId,
printMode: render.PrintMode.PDF
});
var emailBody = "test body";
var emailSubject = "test subject";
email.send({
author: senderId,
recipients: [customerId],
subject: emailSubject,
body: emailBody,
attachments: [pdf],
relatedRecords: {
transactionId: quoteId
}
});
});
Mozsuite
09/25/2019, 9:39 AMMozsuite
09/25/2019, 10:00 AMMozsuite
09/25/2019, 10:00 AMMozsuite
09/25/2019, 2:31 PMObject.prototype.customFunction= function(){}
. This was causing the NetSuite Email module to not recognise the array object I was trying to pass in.