megaphone
SuiteWorld 2026の登録が開始されました。今なら300ドル節約できます。 今すぐ登録しましょう

ディスカッション

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: Field.getSelectOptions(options)メソッド

前の記事NetSuiteの始め方| Understanding SuiteScript 2.x Modulesで、レコードの操作に使用されるSuiteScriptモジュールおよびN/recordモジュールNetSuiteの始め方| N/record Module Overviewを調査しました。ここでは、N/record: Field.getSelectOptions(options) Methodのメンバーの1つについて詳しく説明します。

Field.getSelectOptions(options)は、record.Fieldオブジェクトのメソッドです。ドロップダウン選択、複数選択またはラジオ・フィールドに使用可能な選択肢が返されます。返される各オプションには、オプションの内部値と表示テキストが含まれます。次に例を示します。

[
  { value: 5, text: 'abc' },
  { value: 6, text: '123' }
]

フィールド・オプションの内部IDおよびラベルを名前/値のペアとして返し、動的モードのレコードでのみ使用する必要があり、ガバナンス・コストがなく、クライアントおよびサーバー・スクリプトでサポートされています。

構文

var options = objField.getSelectOptions({
  filter: 'C',
  operator: 'startswith'
});

パラメータ

「N/record」の場合、オプション・オブジェクトは次のものを使用します。

{
  filter: string,
  operator: string
}
  • 「フィルタ」は、返されるオプションを制限するために使用される検索テキストです。フィルタでは大/小文字が区別されません。
  • Operatorは、フィルタの適用方法を制御し、containsis、および startswithをサポートします。これらのリストには、デフォルトおよび必須のリストが含まれています。

サンプル・スクリプト

/**
* @NApiVersion 2.x
* @NScriptType ScheduledScript 
*/

define(['N/record', 'N/log'], function(record, log) {

  function execute(context) {
  
    // Load the Sales Order in dynamic mode.
    // getSelectOptions() requires dynamic mode.
    var salesOrder = record.load({
      type: record.Type.SALES_ORDER,
      id: 25105, //SO Internal ID
      isDynamic: true
    });
    
    // Get the entity field.
    // On a Sales Order, entity is the Customer field.

Richard James Uri - SuiteCloud | WMS Tech | SuiteCommerce Advanced

----

Admin Tips.gif

ようこそ!

サインイン

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

登録

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

リーダーボード

コミュニティの達人

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

今週のリーダー

今月のリーダー

歴代リーダー