Page 1 of 1

databaseManager.recalculate possible a less expansive way?

PostPosted: Fri Dec 16, 2011 2:24 am
by cuoredisardegna@tiscali.i
Hi to all,
we have a relation order_to_order_lines in a form of name Orders wich contains the tabpanel of the relation above.
The amount_field of the order is placed in the form Orders, and after a new record in the tabpanel we need to use "databaseManeger.recalculate", in order to update the amount of the order. But it is too much expensive (many minutes the first time we insert th first record in the tabpanel).

Any idea?

Tanks in advance.
Gianni Pinna.

Re: databaseManager.recalculate possible a less expansive wa

PostPosted: Fri Dec 16, 2011 5:53 am
by Thomas Parry
How many related records are there to recalculate? Surely not that many for the "minutes" that you mention.
Have you tried doing a recalculate on just the one record rather than the whole foundset (of the relation)?
Is the amount that you talk about the sum of all the order lines = the aggregate sum of each order line? And do you use the aggregate capability?

Re: databaseManager.recalculate possible a less expansive wa

PostPosted: Fri Dec 16, 2011 12:50 pm
by cuoredisardegna@tiscali.i
Hi Thomas,
tank You very much for Your answer.
1. ) You wrote
Have you tried doing a recalculate on just the one record rather than the whole foundset (of the relation)?


No I didn' t but I'll try.IT, OF SURE WIL BE BETTER than the command wich, in the while i gave with a good effect:

Code: Select all
order_to_lines_order.loadRecords();


2.) Moreover, Thomas, You wrote:
Is the amount that you talk about the sum of all the order lines = the aggregate sum of each order line? And do you use the aggregate capability?


Yes
Yes.
Many Tanks again, Thomas.
Hope fine for You.
Sincerly.

Gianni Pinna