3457
Views
7
Comments
Solved
Dynamic sort on an Aggregation
Question
I have a screen with a table records with a number of 'normal' fields and one Aggregation (max(DueDate)). I would like to add this Aggregation to the dynamic sort, but i don't see how. I first tried to select the AccountTable.List.Current.DueDateMax in the 'Column' property of the List_SortColumn RichWidget, but although the e-space is valid, when using i get an error message: Invalid syntax in 'OrderBy' parameter. Next i tried to use the original, not Aggregated, entity attribute {Action}.[DueDate], but that doesn't work either.

Does anyone have an idea?
2014-10-08 20-03-52
Luciano Schiavo
Solution
Put a name on the calculated attribute and use this name on the List_Sort_Column. If you try to refer it as table or something like that you will have an error.
2018-10-09 16-37-55
Rodrigo Leonardo Corrêa de Paula

Luciano Schiavo wrote:

Put a name on the calculated attribute and use this name on the List_Sort_Column. If you try to refer it as table or something like that you will have an error.


Thank's for the info, saved me from doing "workarounds" :)

2019-11-11 17-10-24
Manish Jawla
 
MVP
hi,
Can u plz attach the sample oml file.

Thanks,
MJ
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
I think the question is clear enough without a sample OML, but I don't know a solution of the top of my head. Basically, calculated columns need a HAVING in SQL, and I'm not sure whether this is supported by Aggregates. Probably not, come to think of it... Maybe someone from OutSystems can weigh in.
2014-10-08 20-03-52
Luciano Schiavo
Solution
Put a name on the calculated attribute and use this name on the List_Sort_Column. If you try to refer it as table or something like that you will have an error.
2018-10-09 16-37-55
Rodrigo Leonardo Corrêa de Paula

Luciano Schiavo wrote:

Put a name on the calculated attribute and use this name on the List_Sort_Column. If you try to refer it as table or something like that you will have an error.


Thank's for the info, saved me from doing "workarounds" :)

2019-07-02 14-20-37
Leen Rietveld
Yes, that did the trick, see screenshot below. Thanks Luciano!

 
2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Cool, didn't know it worked like that. +1!
2014-10-08 20-03-52
Luciano Schiavo
You are welcome Leen
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.