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.
nlapiMergeRecord
I'm trying to send a merged email from a custom record when a particular field is checked. There is something about the nlapiMergeRecord line that doesn't allow the script to work -- when I // that line the script basically works.
Another smaller problem is I would like to have the copy of the email attached to the custom record mail merge history -- somehow the recordID in the nlapiSendEmail line doesn't work either.
Any suggestions?
function MergeAndSendEmail()
{
var author = nlapiGetUser();
var recipient = nlapiGetFieldValue('custrecordr7nxlicensecontact');
var recordType = nlapiGetRecordType();
var recordID = nlapiGetRecordId();
if ((nlapiGetFieldValue('custrecordr7nxlicensesendactivationemail') == 'T'))
{
var emailBody = nlapiMergeRecord( 172, recordType, recordID, null, null, null );