I have a sales details form which also displays totals by region for sales quantity, sales amount etc.
This worked fine in Axaota 4.0. But , after migrating to Axapta 2009, it takes ages to work out the calculation and display. The grid itself fills up fast. It is only the sum data that is slow.
The code used is looping through query output such as
autosizecolumns() was introduced in some kernel rollup - SP1 KR2 or something.
But I find the whole approach to the summary (“while this.queryrun().next();”) fundamentally wrong. It runs on client, fetchs records one by one etc. I would copy the query, apply any additional criteria (to meet the “based on region” requirement) and use SUM() aggregation function to calculate the value. The result is a single call to database returning a single value and not influencing the datasource in any way.