ディスカッション
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.
支払方法がnullの場合に注文書のP/N参照番号を前受金にコピーする方法
適用
製品: SuiteScript 2.0 - User Event Scripts
シナリオ
次のサンプル・スクリプトは、受注のP/N参照を顧客保証金にコピーします。
解決策
- ロード前関数を含むユーザー・イベント・スクリプトを作成する
- before load関数内で、sales orderフィールドの値を取得し、pnrefnumを取得するスクリプトを使用してレコードをロードします。最後に、フィールドpnrefnumを顧客保証金フィールドに設定する
- スクリプトを顧客保証金にデプロイする
サンプルスクリプト:
/** * NApiVersion 2.x * NScriptType UserEventScript * NModuleScope SameAccount */ define(['N/record'], function(record) { /** * Function definition to be triggered before record is loaded. * * @param {Object} scriptContext * @param {Record} scriptContext.newRecord - New record * @param {string} scriptContext.type - Trigger type * @param {Form} scriptContext.form - Current form * Since 2015.2 */ function beforeLoad(scriptContext) { var x = scriptContext.newRecord.getValue({ fieldId: 'salesorder' }); var recordObj = record.load({ type: record.Type.SALES_ORDER, id: x, isDynamic: true }); var y = recordObj.getValue({ fieldId: 'pnrefnum' }); scriptContext.newRecord.setValue({ fieldId: 'pnrefnum', value: y, ignoreFieldChange: true }); } /** * Function definition to be triggered before record is loaded.
タグ付けされた:
0