N/search
を使用することは間違いありません。これは1.0 APIの類似APIをnlapiCreateSearch
という形で使用しています。
検索オブジェクトを作成するにはsearch.create
、保存された検索を読み込むにはsearch.load
を使用します。次に、結果の検索オブジェクトに対してrun
を呼び出します。私は、
each
メソッドを使用して、コールバック
- 以下の例では結果
の具体的な数を取得するためにgetRange
メソッドを使用します。最後に、次の2つの方法で結果を処理することができますN/search
を私のモジュールにs
としてインポートし、each
メソッドの使用法を示しました。
function findCustomers() {
// Create and run search
s.create({
"type": "customer",
"filters": [
['isinactive', s.Operator.IS, 'F'], 'and',
['company', s.Operator.NONEOF, ['123','456']
],
"columns": ['email', 'firstname', 'lastname']
}).run().each(processCustomer);
}
function processCustomer(result) {
// do something with Customer search result
// returns a boolean; true to continue iterating, false to stop
return true;
}
https://netsuite.custhelp.com/app/answers/detail/a_id/43702/kw/N%2Fsearch – W3BGUY