ディスカッション
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.
nlapiLookupFieldによって返される複数選択フィールドの値を取得
適用
製品: NetSuite 2023.1
シナリオ
nlapiLoadRecordを使用してからnlobjRecord.getFieldTexts関数を使用して複数選択フィールドの選択値を取得すると、配列が返されますが、nlapiLookupFieldを使用して値を取得しようとすると文字列値が返されます。
これを配列に変換するには、split()などのJavaScript関数を使用して、文字列をsubstringの配列に分割します。
解決策
サンプルスクリプトは以下となります。
var multi_select = nlapiLookupField('inventoryitem', , 'custitem_multi_select', true); // "custitem_multi_select" is a custom multi-select field created on the inventory record.
var split_multiselect = multi_select.split(","); // use split function to return an array of substrings and parameter would be comma (",") as the values is separated with comma.
//Then you loop through the array to get the values
for (var x=0; x < split_multiselect.length; x++)
{
nlapiLogExecution('DEBUG','DEBUG',split_multiselect[x]);
}
免責事項
ここに記載されているサンプルコードは、法律で認められている最大限の範囲で、いかなる種類の保証もなく、「現状のまま」で提供されています。Oracle+NetSuite社は、開発者がそれぞれの開発プラットフォームにサンプルコードを実装したり、独自の Web サーバー構成を使用したりする際に、個々の成功を保証するものではありません。
Oracle + NetSuite社は、サンプルコードに関連するデータまたは情報の使用、使用結果、正確性、適時性または完全性に関して、いかなる保証も行わず、表明もしません。Oracle + NetSuite社は、明示的にも黙示的にもすべての保証を放棄し、特に、商品性、特定目的への適合性、およびコード、またはそれに関連するサービスやソフトウェアに関連する保証を放棄します。
Oracle + NetSuite社は、本サンプルコードに関連してお客様または他者が行った行為に起因するいかなる種類の直接的、間接的または結果的な損害または費用についても責任を負いません。
タグ付けされた:
0