Group the data within the query search.

 To group the data in the query search, we can add the groupBy: true to the column we want to group in the query and add the aggregate to the column for the aggregation. for example: query.Aggregate.SUM

sample code:

 itemJoin.createColumn({
                        fieldId: 'itemId',
                        alias: 'itemName',
                        groupBy: true
                    }),
                    statusJoin.createColumn({
                        fieldId: 'name',
                        alias: 'status',
                        groupBy: true
                    }),
                    requisitionQuery.createColumn({
                        fieldId: 'custrecord_cs_ot_cost_qty',
                        alias: 'quantity',
                        aggregate: query.Aggregate.SUM
                    }),

Aggregate values:

Leave a comment

Your email address will not be published. Required fields are marked *