ディスカッション
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.
SuiteScript 2.0を使用して、既存の注文書に関連付けられたプライベートな定期請求を作成する
適用
製品: NetSuite 2024.2
シナリオ
SuiteScript 2.0のユーザーイベントスクリプトを用いて既存注文書に紐付いたプライベート定期請求を作成したい。
解決策
注文書へデプロイされたユーザーイベントスクリプトの送信後機能で以下の例コードを実行します。
if(context.type == context.UserEventType.EDIT){
var recordId = scriptContext.newRecord.getValue({
fieldId: "id" // get internal Id of the current sales order
})
var billingScheduleRec = record.create({
type: 'billingschedule',
isDynamic: true //create a billing schedule record
});
billingScheduleRec.setValue({
fieldId: 'name',
value: 'BlilingSchedViaScript' //set the name of the billing schedule record
});
billingScheduleRec.setValue({
fieldId: 'initialamount',
value: 2 // set the initial amount field
});
billingScheduleRec.setValue({
fieldId: 'numberremaining',
value: 2 // set the number remaining field
});
var frequencyField = billingScheduleRec.getField('frequency');
var frequencyOptions = frequencyField.getSelectOptions(); //get the list of frequency options
billingScheduleRec.setValue({
fieldId: 'frequency',
value: frequencyOptions[2].value //set the frequency field this is weekly
});
billingScheduleRec.setValue({
fieldId: 'ispublic',
value: false // set the public checkbox to false
});
billingScheduleRec.setValue({
fieldId: 'transaction',
value: recordId // set the transaction field to the current sales order internal Id
});
var billingSchedId = billingScheduleRec.save({
enableSourcing: true,
ignoreMandatoryFields:
タグ付けされた:
0