I want to create a search for all events and numbe...
# suitescript
a
I want to create a search for all events and number of attendees, is that possible? at the moment my search result shows one row for each event per attendee, I just need event id and the number of attendees.
b
have you tried the attendee column or the attendee join
a
@battk yes and the result was one object per attendee for each event
also there is a problem with date I want to filter events from now to next 6 month but it will show events from 2019 and 2018 and etc
I have used both date and Instance Start to create a saved search
b
If you only want one search result then use summary columns to group by internal id and count attendees
When searching dates there are 2 general techniques
Use a relative filter
Or if you are scripting, programmatically use Date objects to precisely define your ranges
a
what is relative filter?
b
message has been deleted
a
many thanks
could you please let me know how can I use summary for count attendees?
a
I think it's not possible with one search
I have 30 events
I want to see attendees for all of them in one column like internal id column
is that possible?
b
group on a column that is the same for all of them
if one doesn't exist, then group by a formula with a hardcoded value (though this tends to work less well in the ui)
a
Thanks I've found it now I can see internal id and attendees count for each id now if I want to see event organiser I have to group that column as well. is that correct?
I've grouped internal id and count attendees so far
b
columns that are grouped mean that rows with the same values are grouped together in the same row on the results
if you group by internal id and organizer then rows with the same internal id and organizer are grouped together
since internal id is unique, no additional grouping will occur so you only get an additional column showing organizer
a
is it possible to see organiser without that additional grouping?
when I work with netsuite, always I have to fix the numbers because it will print 5.0 instead of 5(shall we use toFix() or there is a better way?)
b
more columns are the way to see more data
not sure what your number problem is
are you referring to the ui or script?
a
ui
print a list in the ui
all the numbers are with .0
5 -> 5.0
6 -> 6.0 and ...
for example
Copy code
portlet.addRow({
    row: {
        numbre: maxNum - 5
    }
})
will show 7.0 max number is 12
b
probably use toFixed
a
why it's like that
is that netsuite problem? we shouldn't use toFix always for this simple job
b
i would guess its because netsuite only has a single Number type and its a float
netsuite runs its servers using java, and the conversion between a Javascript Number and a Java equivalent used something with decimal points in its print representation