Hi everyone,
I have a scheduled script to send notices to clients when their due dates on invoices are coming up. This script executes successfully via the debugger, but upon validating functionality I did notice that the record of the email sent is not attached to the invoice or client record. Below is a snip that contains the merge function and setting a custom field value on the transaction record. Can someone tell me how to get the sent email to show up in the communication tab of the transaction or client record?
var emailMerger = nlapiCreateEmailMerger('123');
emailMerger.setEntity('customer', customerID);
emailMerger.setTransaction(internalID);
var mergeResult = emailMerger.merge();
var emailSubject = mergeResult.getSubject();
var emailBody = mergeResult.getBody();
nlapiSendEmail(fromID, email, emailSubject, emailBody);
nlapiSubmitField('invoice', tranid, 'custbody_processed', 'T');
Thanks!!!
This is a cached copy. Click here to see the original post.