ディスカッション
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 2020.1
SuiteApp: SuiteScript 2.0 - User Event Scripts
シナリオ
ラインアイテムの在庫詳細を更新するユーザーイベントスクリプトが発注にデプロイされます。ユーザーがXボタンをクリックして在庫詳細を更新し、新しいものを作成すると、予期せぬエラーが発生します。これは、「送信前」でスクリプトがトリガーされた場合に発生します。「在庫詳細」は最初に削除することで再作成され、「送信前」では変更はまだ保存されていません。
解決策
これを修正するには、発行後トリガーの在庫詳細を更新するスクリプトを更新します。以下は、発行前から発行後に更新されたサンプルスクリプトです:
Before Submit:/** * NApiVersion 2.x * NScriptType UserEventScript * NModuleScope SameAccount */ define(['N/record'], function (record) { function beforeSubmit(context) { var newRec = context.newRecord; var subrec = newRec.getSublistSubrecord({ sublistId: 'item', fieldId: 'inventorydetail', line: 0 }); subrec.setSublistValue({ sublistId: 'inventoryassignment', fieldId: 'quantity', value: 1, line: 0 }); subrec.setSublistValue({ sublistId: 'inventoryassignment', fieldId: 'receiptinventorynumber', value: 'LOT#123', line: 0 }); }; return { beforeSubmit: beforeSubmit }; });After Submit:
/** * NApiVersion 2.x * NScriptType UserEventScript * NModuleScope SameAccount */ define(['N/record'], function (record) { function afterSubmit(context) { var newRec = record.load({ type: context.newRecord.type, id: context.newRecord.id, }); var subrec = newRec.getSublistSubrecord({ sublistId: 'item', fieldId: 'inventorydetail', line: 0 }); subrec.setSublistValue({ sublistId: 'inventoryassignment', fieldId
タグ付けされた:
0