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:
