Page 1 of 1

aggregations recalculating

PostPosted: Mon Jun 05, 2006 12:05 pm
by rodneysieb
Hi all

coming from a FMP world i am used to updating a record through a portal and seeing it recalculate everywhere else it is related to (to the great cost cost of reporting times, however)

I need to understand better how aggregations are updated in servoy? using an example of a database with invoices to line items to inventory schema.

The aggregation resides in the line items table and can be viewed via relationship by either invoices or inventory, right? If i change a lineitem record (through a portal for instance) in the invoices table this will update the aggregation by this relationship, fine.

What it doesn't seem to be doing is automatically upgrading the aggregation via the related inventory record unless i visit the record in the inventory table, then it will recalculate

I am currently getting around this by forcing a save record on data change of the line item and loading the related inventory values into variables thus forcing the calculation and updating. This is quickly becoming a pain in the ass programming for every possible option and slowing the database.

Am i doing this right by forcing the updates or is their a smarter way of recalculating the aggregations for other related tables.?

PostPosted: Tue Jun 06, 2006 12:44 pm
by Jan Blok
aggregates are retreived again from the database when the row field on which the aggregate is based are changed.

PostPosted: Wed Jun 07, 2006 10:12 am
by rodneysieb
Hi Jan

Thanks for your reply.

The aggregates as you say is updated/retrieved when the row is changed, i can see a lineitem aggregation update if i am on for example a purchase table editing the line items in a portal. the aggregation updates correctly as viewed via the relationship purchases_to_lineitems, fine.

The issue occurs when the lineitem aggregation that was changed in the purchases_to_lineitems does not update as viewed by another related table eg. inventory_to_lineitems. It does update when i can see the record in inventory. But does not automatically update for example if i print a stock report of all inventory, unless i force the update by method

Hope this makes sense.

PostPosted: Wed Jun 07, 2006 11:13 am
by Jan Blok
please file a support case with a sample solution demonstrating the problem at:
http://crm.servoy.com/servoy-webclient/ ... oy_support