``` search.createFilter({ ...
# suitescript
r
Copy code
search.createFilter({
                name: 'formulanumeric',
                formula: 'count(lineuniquekey)',
                operator: search.Operator.LESSTHAN,
                values: 10000,
            })
Any ideas why this formula is returning an error? Searching on a Sales Order record.
b
summary filters require at least one grouping summary column
a difference between the ui and scripts is that the ui will ignore the summary filter while a script throws an error
r
Got you, thanks
Copy code
columns: [
            search.createColumn({
                name: 'internalid',
                label: 'Internal ID',
                summary: search.Summary.GROUP
            }),
        ],
Grouping like so but it doesn't like my formula for some reason.
b
your formula may be off, mostly because it doesnt look like a formula
create the search you want in the ui
then load it in script to see what the filter looks like
r
Yup, that's what I did. Originally it looked like:
Copy code
["count(lineuniquekey)","lessthan","10000"]
But I was just trying to convert it into the typed options
b
thats the filter expression
look at the filter instead
importantly, that filter expression is not a formula