netsuite - emailMerger.setEntity() Seems to be not merging the used template with the entity -


i'm trying send template mail(scriptable) on user event customer in sandbox , below code :

var emailmerger = nlapicreateemailmerger('22'); emailmerger.setentity('customer', customerid);  // emailmerger.setrecipient('customer', customerid); var mergeresult = emailmerger.merge(); var emailsubject = mergeresult.getsubject(); var emailbody = mergeresult.getbody();   emailbody = emailbody.replace('{1}', name); emailbody = emailbody.replace('{2}', date);  nlapisendemail('20', 'user1@mytestserver.com', 'test mail',emailbody, null, null, null, null); 

but unfortunately, i'm unable see mail merged under communication tab in customer. i'm missing here ?

var obj = nlapiloadfile(9398); var records = new object(); records['entity'] = '1752'; nlapisendemail('-5', '-5', 'emailsubject','emailbody', null, null, records, [obj]);  work mail , attachment save in communication tab. 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -