Hi,
I'm trying to have a fulfillment email sent out via nlapiSendEmail attach itself to the communications subtab of a sales order but am having no luck. I can attach it to the fulfillment and a PO (not that I want to) as follows ("record" is the fulfillment in question):
var associates = {}; var entityID = record.getFieldValue( 'entity' ); if( isDefined( entityID ) ) { associates[ 'entity' ] = entityID; } var transactionID = record.getId(); if( isDefined( transactionID ) ) { associates[ 'transaction' ] = transactionID; }But when I try for the sales order record neither of the below: var salesOrderID = record.getFieldValue( 'createdfrom' ); if( isDefined( salesOrderID ) ) { associates[ 'record' ] = salesOrderID; }or var salesOrderID = record.getFieldValue( 'createdfrom' ); if( isDefined( salesOrderID ) ) { associates[ 'salesorder' ] = salesOrderID; }work. I can supply the resulting associative array as the records argument of a nlapiSendEmail call and it executes without complaint -- but creates a communications item on the other two records and not the sales order. Am I referencing the sales order wrong? I think I'm following SuiteAnswer ID 10247 correctly, but I must be missing something. Thanks for your help!Bob