ディスカッション
AIを用いた自動化で請求書処理を合理化
AIを用いた考察を使用して、計画と予測を迅速化
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
NetSuite の始め方 | SuiteScript 2.x レコードでスクリプトタイプを設定する方法
SuiteScript 2.x は、NetSuiteの機能を強化し拡張するためのJavaScript APIです。SuiteScriptを使用すると、ページの動作をカスタマイズしたり、特定の要件に基づいてワークフローを設定したり、タスクをスケジュールしたりすることが可能です。
シナリオ:
顧客はSuiteScript 2.x レコードを作成したいが、ユーザーイベントのSuiteScriptタイプの設定方法が分からない。
解決方法:
スクリプトのタイプを設定するためには、JavaScriptファイルにSuiteScriptタイプを含める必要があります。そのためには、以下の手順を実行します。
JavaScriptファイル内で、エントリーポイントのコメントブロックにてNScriptTypeを使用してSuiteScriptのタイプを記述します。必要なのは、NApiVersionとNModuleScopeのフォーマットを含めることです。
/** * @NApiVersion 2.x * @NScriptType UserEventScript * @NModuleScope SameAccount */
注意:
この形式はJSDoc3(JavaScript Documentation)であり、JavaScriptソースコードのドキュメンテーションを生成するツールとして機能します。開発者は指定されたコメントブロックをコード内に組み込むことで、ドキュメンテーションを生成し利用することができます。コメントブロックは「/**」で始まり「*/」で終わります。
JSDocには、@記号で始まるJSDocタグを使用した独自のマークアップ言語が含まれています。
この方法で、コメントブロックに以下のJSDocフォーマットを使用して値を追加する必要があります:
- @NApiVersion: 2.x を追加します。
- @NScriptType: UserEventScript を追加します。
- @NModuleScope: SameAccount を追加します。
SuiteScriptタイプのフォーマットについては、SuiteAnswersのテーブルを参照してください。
これにより、SuiteScript 2.x を使用したスクリプトタイプの設定方法について理解できました。
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!
- Expand your NetSuite knowledge by joining this month's Ask A Guru Live about Advanced Accounting. RSVP on this event now!
