ディスカッション
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管理者ヒント|スイートレットでのsetSublistValueエラーの回避
NetSuite SuiteScript 2.x APIを使用してSuiteletを作成する際に、"Missing a required argument: options.value"という一般的なエラーが発生する可能性があります。
これは通常、少なくとも1つのsetSublistValue()コールが未定義またはnull値を受信することを意味します。
データが存在すると考えても、このエラーは次の場合に発生する可能性があります。
- 検索列は値を戻しません。
- 列名の不一致があります。
- 一部のレコードでは、フィールドが空です。
- 値タイプに互換性がありません。
setSublistValue()メソッドには有効な値が必要です。渡す値が以下の場合:
- 未定義
- ゼロ
- 互換性のないタイプ
すぐにエラーをトリガーします。
これは、次からデータをプルする場合に特に一般的です。
- search.create()
- result.getValue()
フィールドが空の場合、nullが返されるため。
使用例
次のサンプル・スクリプトは、設定前に値を記録し、値が文字列に安全に変換された場合にのみ値を設定し、エラーを完全に回避します。
/**
* @NApiVersion 2.x
* @NScriptType Suitelet
*/
define(['N/search', 'N/ui/serverWidget', 'N/log'], function(search, serverWidget, log) {
/**
* Suiteletサブリストのnull/未定義文字列を空の文字列に変換.
* @param {any} val
* @returns {string}
*/
function safeValue(val) {
return (val !== undefined && val !== null) ? String(val) : '';
}
/**
* Main Suitelet entry point
*/
function onRequest(context) {
// 顧客データを表示するSuiteletフォームを作成します
var form = serverWidget.createForm({ title: 'Customer List' });
// 顧客表を表すリスト・タイプのサブリストをフォームに追加します
var sublist = form.addSublist({
id: 'custpage_customersublist',
type: serverWidget.SublistType.LIST,
label: 'Customers'
});
// サブリストの表示列の定義
sublist.addField({
id: 'custpage_entityid',
label: 'Entity ID',
type: serverWidget.FieldType.TEXT
});
sublist.addField({
id: 'custpage_email',
label: 'Email', 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
