Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Help with nlapiMergeRecord
Hi All,
I am trying to use the nlapiMergeRecord and nlapiSendEmail API's to merge and send a customer's details
I have no problem in sending the email template to the customer but none of the fields are mergin onto the email template???
below is my code
function executeSavedSearch(){ //locate the saved search var searchresults = nlapiSearchRecord('customer', 3178, null, null); for (var i = 0; searchresults != null && i < searchresults.length; i++) { //locate some values of the saved search var customerid = searchresults[i].getId(); var companyname = searchresults[i].getText('companyname') nlapiLogExecution('DEBUG', 'Getcompany', 'company id is: ' + customerid + ' and the company name is: ' + companyname); merge_fields_arr = new Array(); //I have got'NLADDRESS' referenced on my template but is not replicating on the adress on send of email merge_fields_arr['NLADDRESS'] = 'TEST ADDRESS'; var emailbody = nlapiMergeRecord( 92, 'customer', customerid, null, null, merge_fields_arr).getValue(); nlapiSendEmail(138006, 0