I am having an issue with a search, it is returnin...
# suitescript
d
I am having an issue with a search, it is returning more results than expected.
Copy code
var estimateSearchObj = search.create({
   type: "estimate",
   filters:
   [
      ["type","anyof","Estimate"], 
      "AND", 
      ["status","anyof","Estimate:X","Estimate:C"]
   ],
   columns:
   [
      search.createColumn({name: "tranid", label: "Document Number"}),
      search.createColumn({name: "trandate", label: "Date"})
   ]
});
var searchResultCount = estimateSearchObj.runPaged().count;
The search should only return expired and closed quotes. The results for this return 8 results for the same document ID
When using standard list view for quotes and applying a filter for expired & closed the list only provides a single result.
m
Add a filter for mainline
👍 1
e
It's also a good idea when you have trouble to add a title attribute and call .save() so you can review the results and the search definition in the UI. Oftentimes that would help.
d
Cool, any idea where they are hiding the field for customer on quotes? On the form it says its the entity field but for some reason on the saved search area it doesn't provide entity as a option for results.
@ec I am actually building the search out on the UI
e
Name