ディスカッション

NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
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.

注文書のアイテムに配送の保管棚番号を追加する

編集済:Oct 9, 2025 2:58AM SuiteCloud / カスタマイズ

適用

製品:  NetSuite 2025.1

シナリオ

ユーザーから、アイテム出荷レコードで割り当てられているBin番号を取得し、それを受注(Sales Order)レコードに表示したいというご要望がありました。

解決策

注文書のアイテム・サブリストに保管棚番号を追加するには、以下の手順を実施します。

  1. カスタマイゼーション > リスト、レコード、およびフィールド > トランザクション・ライン・フィールド > 新規 へ移動し、注文書へ追加するカスタムのトランザクション・ライン・フィールドを作成します。次の値も設定します。

    • ラベル:保管棚番号
    • ID: _bin_number
    • 種類:テキスト・エリア
    • 値を保存:マークします
    • 次に適用:販売アイテム
       
  2. 保存を押下します
  3. スクリプトのレコードを作成します。

    1. カスタマイゼーション > スクリプト > スクリプト > 新規 へ移動します
    2. 後述のサンプルコードのファイルをアップロードします
    3. スクリプトレコードを作成のボタンを押下します
    4. 名前を入力します
    5. 保存を押下します
  4. デプロイメントレコードを作成し、次の値を設定します

    • 次に適用:配送
    • ステータス:テスティング/リリース済
    • ロール:すべてを選択マークします
  5. 保存を押下します


以下のサンプルコードを参照し、「*.js」ファイルとして保存します。

Client SuiteScript 2.0:

function saveRecord(scriptContext) {
var itemFulfillRec = scriptContext.currentRecord
var itemFulfillCreatedFrom = itemFulfillRec.getValue({ fieldId: 'createdfrom' })
var itemCount = itemFulfillRec.getLineCount({ sublistId: 'item' })

//make sure to define the N/record module
//this will load the Sales Order where the item fulfillment is created
var soRec = record.load({
type: record.Type.SALES_ORDER,
id: itemFulfillCreatedFrom
})

for (var i = 0; i < itemCount; i++) {

//pulling the inventory detail subrecord in itemfulfillment
var inventoryDetailRec = itemFulfillRec.getSublistSubrecord({
sublistId: 'item',
fieldId: 'inventorydetail',
line: i
})

//pulling the binnumber text from the inventory detail sub record
var binNumber = inventoryDetailRec.getSublistText({
sublistId: 'inventoryassignment',
fieldId: 'binnumber',

ようこそ!

サインイン

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

登録

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

リーダーボード

コミュニティの達人

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

今週のリーダー

今月のリーダー

歴代リーダー