Hi All,
I am not sure if this is a bug in servoy or I am doing something wrong, but I have the following problem.
I have a parent orders form with a portal showing related records, each related record has a simple calculation field eg. return qty*cost then I have a sum aggregation of that calculation field displayed on the parent form through a relationship eg orders.line_items.sumTotal, every thing works as expected until a second aggregation is added in the line_items table.eg sumTotal, countTotal then the aggregation no longer updates.
below are the sql statements from performance log
With 2 aggregates example
00:00:000 1 00:00:000 Update update line_items set cost=?, sub_total=? where line_item_id = ?
With 1 aggregate example
00:00:000 1 00:00:000 Aggregate SQL select sum(sub_total) as lineTotal from line_items where orders_id = ? limit ?
00:00:000 1 00:00:000 Update update line_items set qty=?, sub_total=? where line_item_id = ?
The second example works as expected.
I am using
Servoy Developer
Version 3.5.6-build 519
Java version 10.0-b19 (Windows XP)
OK,
I just noticed that if I display the second related aggregate field on the parent (Orders) form both update with the correct value … That seems strange. Help Please
I guess you posted here the solution that is working, right ? I added a second aggregation on line_items which is a count for sub_total column. Then I displayed this aggregation both on portal and main form and it works well . Do you use other aggregation as the second one ? Do you have any errors in the log ?
the problem seems to be when you do not display the second aggregate on the parent form.
OK,
I just noticed that if I display the second related aggregate field on the parent (Orders) form both update with the correct value … That seems strange. Help Please
I have attached a new sample solution to demonstrate the problem in a clearer way.
I checked your solution and it seems to be a bug. Please submit an issue to http://crm.servoy.com/servoy-webclient/ … oy_support and link to this topic. I noticed this only happens when having an aggregation on stored calculation ( so if a column works well); also the ‘average’ aggregation works well, this is why the last example works, that aggregation updates its value so all the others will be refreshed as well. Maybe this will help to get a workaround until the problem will be fixed.