ディスカッション

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.

OneWorldで在庫調整にクライアントスクリプトで勘定科目とAdjlocationを設定する

適用

製品:  NetSuite 2023.1

 



シナリオ

OneWorld NetSuiteアカウントにて、在庫調整の勘定科目とAdjlocationのフィールドを設定したいです。



解決策

在庫調整レコードの勘定科目とAdjlocationフィールドの値は子会社レコードに依存します。そのため、クライアントスクリプトのソーシング後に勘定科目とAdjlocationを設定するには、ユーザーイベントスクリプトを介して子会社の値を設定する必要があります。以下のサンプルコードを参照します。

ユーザーイベントスクリプト:

 
define([ 'N/error' ], function(error) { 
 function beforeLoad(scriptContext) { 
  var MyRecord = scriptContext.newRecord; 
  MyRecord.setValue({ 
   fieldId : 'subsidiary', 
   value : 2, 
   ignoreFieldChange : true, 
   fireSlavingSync : true 
  }); 
  log.debug({ 
   title : 'Debug Entry', 
   details : 'Setting Account value' 
  }); 
  MyRecord.setValue({ 
   fieldId : 'account', 
   value : 133, 
   ignoreFieldChange : true, 
   fireSlavingSync : true 
  }); 
 } 
 
 return { 
  beforeLoad : beforeLoad 
 }; 
}); 
 
クライアントスクリプト: 
 
define([ 'N/error', 'N/currentRecord' ], function(error, currentRecord) { 
 function pageInit(context) { 
  } 
 
 function fieldChanged(context) {   
 } 
  
 function postSourcing(context) { 
  debugger; 
  if (context.fieldId == 'subsidiary') { 
   alert('subsidiary changed'); 
   var MyRecord = currentRecord.get(); 
   MyRecord.setValue({ 
   fieldId : 'account', 
   value : 134, 
   ignoreFieldChange : true, 
   fireSlavingSync : true 
  }); 
  alert('subsidiary=' + MyRecord.getText({ 
   fieldId : 'subsidiary' 
  })); 
  if (MyRecord.getText({ 
   fieldId : 'subsidiary' 
   }).trim() == 'UK Subsidiary

ようこそ!

サインイン

完全な詳細を表示するには、サインインしてください。

登録

アカウントがありませんか?ここをクリックして始めましょう!

リーダーボード

コミュニティの達人

第2四半期 (4月~6月 2026)

今週のリーダー

今月のリーダー

歴代リーダー