Anything wrong with this code? ```search.create({...
# suitescript
a
Anything wrong with this code?
Copy code
search.create({
                type: 'phonecall',
                columns: [{name: 'assigned', summary: 'group'}],
                filters: [['date', 'within', ['01/01/2020', '14/10/2020']]]
            }).run().each(res => {
                result[res.id] = res.getValue({name: 'assigned', summary: 'group'});
                return true;
            });
d
Capitalise GROUP?
a
No difference, same error (unexpected error)
b
try it using 2.0 first
otherwise start removing things until the error goes away
canidates include the columns, filters, and your link using getValue
the stacktrace should help you out in picking where to start
a
Using 2.0?
d
search type enum wrong?
b
use suitescript 2.0
a
It is 2.0
d
search.Type.PHONE_CALL
a
No that's not the issue
But if I delete summary it will work
But I want to use summary
@battk why you think it is not 2.0?
Should I write it another way
b
Copy code
res => {
arrow function expressions are not supported by 2.0
s
well the columns probably needs a
search.createColumn
around the object
b
you would need something that transpiles javascript for that to work in 2.0
a
Yes I have
I've tried group summary in ui and that didn't work too
@Sandii I don't think that's the issue
I have loads of search with this syntax just without summary
s
your arrow fn is still a problem if this is 2.0
a
Ok what else
b
your code doesn't error for me if i change the date filter to an actual filter like createdate
wont work as you expect since grouped columns dont have ids, but it doesnt error
a
When I want to use
Group summary in ui
Shall I set anything else?
Because even in ui I have unexpected error
When I set result summary for assigned field to group
@battk how can I drill down grouped search?
b
message has been deleted
a
I have exactly the same and when I run it
It's unexpected error
b
unexpected errors generally should start as netsuite support cases
a
But in general how can I drill down in ss2
b
not a thing in suitescript
a
So I can't drill down in suitescript?
b
nope, you have to make a different search
a
Anything else
Like query module
Or something
s
Why would you need to drill down in suitescript, just make it an ungrouped search if you need the detail and handle the grouping while you process the results.
a
Yes I can do that
Thanks all