ディスカッション
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.
SuiteScriptで値の配列にループする時、「のいずれか」のオペレーターの利用
適用
製品: NetSuite 2022.1
シナリオ
SuiteScriptの検索オペレーターで配列の値をアクセスする方法は複数あります。今回、「のいずれか」のオペレーターで配列の全ての値にループします。
解決策
以下のコードは、「のいずれか」のオペレーターでアイテムの内部IDでシステムノートの中に「clearance」の値を検索します。
var itemIntIds = [83, 59];
var data = [],
datestr = '',
mdy = [],
i, j;
var columns = new Array();
columns[0] = new nlobjSearchColumn("date");
columns[1] = new nlobjSearchColumn("recordid");
var filters = new Array();
for (j = 0; j < itemIntIds.length; j++) {
filters[0] = new nlobjSearchFilter("recordid", null, "anyof", itemIntIds[j]);
}
filters[1] = new nlobjSearchFilter("newvalue", null, "is", "clearance");
var recs = nlapiSearchRecord("SystemNote", null, filters, columns);
if (recs != null) {
for (i = 0; recs != null && i < recs.length; i++) {
var retCols = recs[i].getAllColumns();
var obj = {};
obj.id = recs[i].getValue('recordid');
datestr = recs[i].getValue('date');
mdy = datestr.split(' ');
obj.dateCreated = mdy[0];
data.push(obj);
}
}
免責事項
ここに記載されているサンプルコードは、法律で認められている最大限の範囲で、いかなる種類の保証もなく、「現状のまま」で提供されています。Oracle+NetSuite社は、開発者がそれぞれの開発プラットフォームにサンプルコードを実装したり、独自の Web サーバー構成を使用したりする際に、個々の成功を保証するものではありません。
タグ付けされた:
0