ディスカッション
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 の始め方 | N/record: record.Sublistオブジェクト
前の記事NetSuiteの始め方 | SuiteScript 2.xモジュールについてで、レコードの操作に使用されるSuiteScriptモジュールおよびN/recordモジュール、「NetSuiteの始め方 | N/recordモジュールの概要」を学習しました。次に、N/record: record.Sublist Objectのメンバーの1つを詳しく見ていきます。
record.Sublistオブジェクトは、レコード内のサブリストを表します。サブリストは、基本的に、レコードに関連付けられたライン・アイテムのリストです(たとえば、注文書のアイテム・サブリストや仕入先支払請求書の経費サブリスト)。
キー・ポイント:
- record.Sublistオブジェクトは、行へのアクセス、値の設定と取得、サブリスト行データの操作など、サブリストと対話するためのメソッドとプロパティを提供します。
- record.Sublistオブジェクトは直接インスタンス化されません。かわりに、通常は次を使用して、Recordオブジェクトのメソッドを介してアクセスします。
record.getSublist({ sublistId: 'item' });
- サブリスト行の直接操作は、多くの場合、次のものを使用して行われます。
- record.getSublistValue(オプション)
- record.setSublistValue(オプション)
- サブリストを使用するためのその他の関連メソッド。
- サブリストとは、行のリスト/配列全体を指し、提供されているAPIを使用して特定の行と対話します。
サポートされているスクリプト・タイプ
record.Sublistオブジェクトは、クライアント・スクリプトとサーバー側スクリプトの両方でサポートされています。
例: 注文書レコードをロードし、アイテム・サブリストのすべてのアイテムを繰り返し処理し、各アイテムの内部IDを記録します。
/**
* @NApiVersion 2 .x
* @NScriptType ScheduledScript
*/
define(['N/record', 'N/log'],
function(record, log) {
function execute(context) {
try {
var salesOrderId = 12345; // Replace with your Sales Order internal ID
var soRecord = record.load({
type: record.Type.SALES_ORDER,
id: salesOrderId
});
var lineCount = soRecord.getLineCount({sublistId: 'item'});
log.audit('Line Count', lineCount);
for (var i = 0; i < lineCount; i++) {
var itemId = soRecord.getSublistValue({
sublistId: 'item',
fieldId: 'item',
line: i
});
var quantity = soRecord.getSublistValue({ Richard James Uri - SuiteCloud | WMS Tech | SuiteCommerce Advanced
----
- NetSuite Admin Corner | New to NetSuite
- Explore the NSC Webinars Category
- Join our poll and share your ideas! We want to know what you think. Don't forget to comment and make your voice heard!
タグ付けされた:
0
