aggregations recalculating

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

aggregations recalculating

Postby rodneysieb » Mon Jun 05, 2006 12:05 pm

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.?
Regards,
Rodney Siebenhausen

logic@work
Brisbane, Australia
rodneysieb
 
Posts: 260
Joined: Tue Feb 14, 2006 9:11 am
Location: Brisbane, Australia

Postby Jan Blok » Tue Jun 06, 2006 12:44 pm

aggregates are retreived again from the database when the row field on which the aggregate is based are changed.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby rodneysieb » Wed Jun 07, 2006 10:12 am

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.
Regards,
Rodney Siebenhausen

logic@work
Brisbane, Australia
rodneysieb
 
Posts: 260
Joined: Tue Feb 14, 2006 9:11 am
Location: Brisbane, Australia

Postby Jan Blok » Wed Jun 07, 2006 11:13 am

please file a support case with a sample solution demonstrating the problem at:
http://crm.servoy.com/servoy-webclient/ ... oy_support
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 11 guests