【发布时间】:2017-01-17 21:56:25
【问题描述】:
我有一个非常大的问题,我的意思是我在一家公司工作,我们使用 NetSuite 作为我们的业务平台,现在他们用新的 API 更新了我们的帐户。
我之前的开发者写了这段代码
for(var k = 0; k < ResultsPPCI.length; k++){
EmployeePPCI = ResultsPPCI[k].getValue('internalid'); //get the value
// log('Internal ID', EmployeePPCI);
// Merge, send, and associate an email with Purchase Order record (id=1000)
var mergeValuesPPCI = {};
mergeValuesPPCI.NLEMPFIRST = nlapiLookupField('employee', EmployeePPCI, 'firstname');
mergeValuesPPCI.NLEMPLAST = nlapiLookupField('employee', EmployeePPCI, 'lastname');
mergeValuesPPCI.NLSUPPLIER = nlapiLookupField('customer', cust, 'companyname');
mergeValuesPPCI.NLPRODUCTCODE = productcodehtml;
var emailBodyPPCI = nlapiMergeRecord(65, 'purchaseorder', poID, null, null, mergeValuesPPCI);
var recordsPPCI = {};
recordsPPCI['transaction'] = poID;
nlapiSendEmail(EmployeePPCI, EmployeePPCI, emailBodyPPCI.getName(), emailBodyPPCI.getValue(), null, null, recordsPPCI);
// log('EmployeePPCI',EmployeePPCI);
nlapiLogExecution('AUDIT', 'Potentional Problem', 'Email Sent');
}
我现在有问题,因为 nlapiMergeRecord 已被弃用,它不会工作。但我真的无法在网上找到任何工作示例......这里最重要的部分实际上是必须发送的这封电子邮件的正文。在这种情况下,它是 productcodehtml 或 mergeValuesPPCI.NLPRODUCTCODE。
这就是我的模板的样子:
<p>The QA Release has been submitted by <nlsupplier> for ${transaction.tranId}.</nlsupplier></p>
<p>The following item(s) have a short shelf life:</p>
<nlproductcode></nlproductcode>
请您帮我将此代码转换为新方法吗?如何将模板中的nlproductcode 与我的代码中的mergeValuesPPCI.NLPRODUCTCOD 连接起来?
提前致谢!
【问题讨论】:
标签: netsuite