Sample code demonstrates how to generate a HTML object using nlapiPrintRecord to print the Transaction. Get the value of the resulting nlobjFile as body of the email message. Send the email using nlapiSendEmail.
 
function email_html(request, response)
{
  var type = 'TRANSACTION';
  var id = 8;
  var mode = 'HTML'; 
  var properties = null;
   var htmlbody = nlapiPrintRecord(type, id, mode, properties); //returns nlobjFile
  var htmlbody = htmlbody.getValue();
  nlapiLogExecution('debug', 'process', htmlbody);
   var email = nlapiSendEmail('-5', '-5', 'Email inline HTML', htmlbody, null, null, null, null);
}  
No comments:
Post a Comment