Reputation: 935
I am trying to get all the sales orders of a particular customer via the search function.
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});
This throws an error,
How do I get a search like this working?
Upvotes: 1
Views: 1805
Reputation: 3783
You have a stray space in your status filter; "status "
, should be "status"
.
You will also need to change the filter value from "Pending Fulfillment" to "SalesOrd:B" in order for your search to return any values.
["status", "anyof", "SalesOrd:B"]
Upvotes: 2