ディスカッション
NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Update: Narrative Insights has been restored and is now available.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
電子メール経由で仕訳帳に関連レコードを送信する
適用
製品: NetSuite 2023.1
シナリオ
仕訳帳の支払サブリストにて、電子メール経由で関連レコードを送信するボタンを追加したいです。
解決策
1. 関連レコードのサブタブに属して、支払のサブリストにボタンを追加するには、以下のコードを含むユーザーイベントスクリプトを作成します
function userEventBeforeLoad(type, form, request){
if (type == 'view' || type == 'edit'){
form.setScript('[id of the script]');
var paymentSublist = form.getSubList('links');
paymentSublist.addButton(
'custpage_sendemail',
'Send RR Email',
'sendInvoicerecords()');
}
}
2. 既述ユーザーイベントスクリプトにて、電子メールを送信する関数を追加します
function sendInvoicerecords() {
var rec = nlapiLoadRecord(nlapiGetRecordType(), nlapiGetRecordId());
var body = '';
var count = rec.getLineItemCount('links');
for(var i=1; i<count; i++){
body += 'DATE: '+rec.getLineItemValue('links', 'trandate', i)+'\n';
body += 'TYPE: '+rec.getLineItemValue('links', 'type', i)+'\n';
body += 'NUMBER: '+rec.getLineItemValue('links', 'tranid', i)+'\n';
body += 'STATUS: '+rec.getLineItemValue('links', 'status', i)+'\n';
body += 'AMOUNT: '+rec.getLineItemValue('links', 'total', i)+'\n\n';
}
var records = new Object();
records['transaction'] = nlapiGetRecordId();
nlapiSendEmail(nlapiGetUser(), nlapiGetUser(), 'Related Records for Invoice#'+rec.getFieldValue('tranid'), body,null,null,records);
}
タグ付けされた:
0