totalling columns in temp tables!

Hello Guys!

I am trying to totalling field’s column in the form to show above of the form,but I am confused.My form’s datesource is temp table.Normally we are writing while select then totalling field but in temp i dont know how to write code and where should i put it.first I thought writing display to show it on form but I am making wrong while select I think.

With normal tables and TempDB tables, you should use the aggregated function called SUM to do the calculation in database and transfer just the result; transferring all records from database and doing the calculation in application is a waste of resources. And you should use the same approach with InMemory temporary tables too, even if there is no communication with database. I’ve documented an example in Summarized values in AX form.

The difference with temporary tables is that you have to pass a reference to the buffer where you inserted data; you can’t simply create a new buffer, because it would be empty. If you follow the example with a query, you should set the temporary buffer to QueryRun via setRecord().