So long as you have columns in that query (I don’t...
# suitescript
s
So long as you have columns in that query (I don’t see them in the snippet above) it should work. In SS2.x, you need to define at least one column. In SS1, a search could be run with no columns defined, though I can’t remember what you get back. Maybe just the internal ids of each record.
🎖️ 2
s
Was gonna say something similar to this, I believe its probably the issue. Although, query is usually really good about telling you exactly what is wrong.
b
Okay, thanks. I'll try including one column.
That worked. Thanks!
👍 1
e
I haven't encountered a problem in SS2+ running a Search with no columns. Unsure about Queries though
b
Apparently queries need to have at least one column.
e
Yeah it would seem so
Curious what the use case is for using a Query instead of a Search
s
I'm starting to evolve to the opinion that I'll use Query only with SuiteQL, and Search for the rest
b
Well I needed it to look up properties of custom fields. Search doesn't support that.
e
Just for confirmation, this
Column
-less Search seems to work fine
Gotcha
s
Interesting. I have definitely had trouble with a column-less search before in a 2.0 script. It’s possible the behavior has changed since then, though, or maybe it is specific to the record type.
Actually, I think the problem was that I was returning it from a Map/Reduce getInputData stage
s
maybe eric's example was 2.1 and behavior improved from 2.0?
e
I don't recall a problem in 2.0 either
s
I know that in traditional searches I commonly provide an empty column list if all I needed is record internal ids as output.
s
Yeah, I am thinking it had more to do with the Map/Reduce not being able to serialize the result set with no columns present. I’ll have to test it again.