How can I run a search for Tasks that have more th...
# suitescript
a
How can I run a search for Tasks that have more than 6 words title?
c
I'd use suiteql with one of the Oracle
REGEXP_
functions in the
where
clause to look for things with more than >5 occurrences of whitespace
var resultset = query.runSuiteQL({ query: "select * from tasks where length(regexp_replace(name,'\S',''))>5" });
a
@CD Thanks, but it shows all of them. I think there is a problem in where clause.
c
Damn, the query works via ODBC 😞
s
You can try using
REGEXP_LIKE({title}, '(\w+\s+){4,}\w+.*')
That would probably treat strings containing numbers as words, too, but you can modify if necessary
m
Another option is
REGEXP_COUNT({memo}, '\s') + 1
for get the number of whitespace characters. Works well in a saved search