0
以下のマージ機能を使用しないと、このコードは保存時にメールを送信しますが、私の人生にとってはメールマージをNetsuite 2.0で利用できません高度なpdfテンプレートをアイテムのフルフィルメントとマージして電子メールで送信しますか?アイテムのフルフィルメントとアドバンストテンプレートをマージしてNetsuite 2.0にメールする
/**
*@NApiVersion 2.x
*@NScriptType UserEventScript
*/
define(['N/email','N/render', 'N/record', 'N/file'],
function(email, record, file,render) {
function afterSubmit(context) {
function templatemerge() {
var myMergeResult = render.mergeEmail({
templateId: 121,
entity: {
type: 'employee',
id: 18040
},
recipient: {
type: 'employee',
id: 18040
},
supportCaseId: 'NULL',
transactionId: 1176527,
customRecord: 'NULL'
});
}
templatemerge();
function sendEmailWithAttachement() {
var newId = context.newRecord;
var emailbody = 'attachment';
var senderId = 18040;
var recipientEmail = '[email protected]';
email.send({
author: senderId,
recipients: recipientEmail,
subject: 'Item Fulfillments',
body: emailbody
});
}
sendEmailWithAttachement();
}
return {
afterSubmit: afterSubmit
};
});
エラーが発生していますか?電子メールテンプレートをマージする構文が正しいように見えます。 – TonyH
TypeError:オブジェクト[オブジェクトオブジェクト]内の関数mergeEmailが見つかりません。 – theinvisibleduck
また、あなたのクロスポストへの私の応答を見ることができますhttps://usergroup.netsuite.com/users/forum/platform-areas/customization/suitescript-2-0-custom-code/411521-cant-get-template-電子メールのマージ・ツー・イン・イン・2-0?p = 411526#post411526 – erictgrubaugh