SuiteScript 2.0 Search.Create 过滤订单状态

SuiteScript 2.0 Search.Create filtering order status

我想通过搜索功能获取特定客户的所有销售订单。

var filters = [
   ["mainline", "is", "T"], "and",
   ["entity", "anyOf", idCustomer], "and",
   ["status ", "anyOf", "Pending Fulfillment"]
];

var searchQuery = search.create({
   "type": search.Type.SALES_ORDER,
   "filters": filters
});

salesorders = searchQuery.run().getRange({"start": 0, "end": 1000});

这会引发错误,

如何进行这样的搜索?

您的状态过滤器中有一个偏离 space; "status ",应该是"status".

您还需要将筛选器值从 "Pending Fulfillment" 更改为 "SalesOrd:B",以便搜索 return 任何值。

["status", "anyof", "SalesOrd:B"]