ディスカッション

NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.

NetSuite の始め方| N/record: Column.idプロパティ

前の記事NetSuiteの始め方 | Understanding SuiteScript 2.x Modulesで、レコードの操作に使用されるSuiteScriptモジュールおよびN/recordモジュールNetSuiteの始め方 | N/record Module Overviewを学習しました。次に、N/record: Column.id Propertyのメンバーの1つを詳しく確認します。

IDプロパティーオブジェクトは、それが表す列の内部IDを返します。この内部IDは、検索作成スクリプトで列を定義する際にフィールドIDを指定するときに使用するのと同じ値です。

たとえば、フィールドIDが 'entityid'のカラムを含めると、そのカラムの.IDプロパティーは 'entityid'を返します。

  • タイプ:プロパティは文字列型です。
  • 読取り専用: Column.idの値は変更できません。読取り専用であり、列の信頼できる識別子として機能します。
  • 目的:このプロパティを使用すると、検索で定義された列のフィールドIDに簡単にアクセスできます。このプロパティは、検索結果を動的に処理または表示する場合に便利です。

スクリプトの例: Column.id

/**
 * @NApiVersion 2.x
 * @NScriptType ScheduledScript 
 */
define(['N/record', 'N/search', 'N/log'], function(record, search, log) {
    function execute(context) {
        // 特定の列を持つ顧客の検索の作成
        var customerSearch = search.create({
            type: search.Type.CUSTOMER,
            columns: ['entityid', 'email'] // column IDs we want
        });

        // 検索を実行し、各結果を処理
        customerSearch.run().each(function(result) {
            // 結果内の列をループ
            result.columns.forEach(function(col) {
                // 列の内部IDとその値を記録
                log.debug('Column ID: ' + col.id, 'Value: ' + result.getValue(col));
            });
            return true; // continue processing more results
        });
    }

    return { execute: execute };
});

このスクリプトでは:

  • このスクリプトは顧客を検索し、entityid列とemail列を尋ねます。
  • 結果ループ内では、col.id

Richard James Uri - SuiteCloud | WMS Tech | SuiteCommerce Advanced

----

Admin Tips.gif

ようこそ!

サインイン

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

登録

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

リーダーボード

コミュニティの達人

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

今週のリーダー

今月のリーダー

歴代リーダー