Re: [Axapta-Knowledge-Village] Dynamic Group by Statement

2009-05-12 Thread Agus Riyadi
Hi, Using query classes you can do that. e.g. q = new Query(); ds = q.addDataSource(tablenum(projInvoiceEmpl)); ds.addSelectionField(fieldnum(projInvoiceEmpl,qty),SelectionField::Sum); ds.addSortField(*fieldnum(projInvoiceEmpl,categoryid)*); ds.orderMode(OrderMode::GroupBy);

[Axapta-Knowledge-Village] Dynamic Group by Statement

2009-05-12 Thread shaakera_b
Hi All, I would like to group and sum by fields dynamically in an AX while statement. Basically I want to sum and group by any field on the table using a setup table. Example: while select sum(qty) from projinvoiceempl group by CategoryID { //Some code which does some stuff with the qty sum }