Jan Blok was slightly mistaken (it's hot currently in Europe
), what he mentions only applies to non-aggregate values.
To aggregate over multiple relations you have to use a SQL query, for example:
- Code: Select all
select sum(t3.numb) from t1,t2,t3 where t1.t1 = t2.t1 and t2.t2 = t3.t2 group by t1.t1;
To get the results of this query onto your form do the following:
1. create a label and place it where you want to see the results. Fill in the name property of the label (to make it show up in the method editor)
2. create a method that says:
- Code: Select all
var query = "select sum(t3.numb) from t1,t2,t3 where t1.t1 = t2.t1 and t2.t2 = t3.t2 group by t1.t1";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, null, maxReturedRows);
elements.labelxxx.text = dataset.getValue(1,1);
replace labelxxx with the name you gave to the label earlier
Add this method to the onRecordSelection event so it will be triggered each time the record is selected.