How to Pass an Aggregate to Web Block as an Input Parameter Dynamically at Run Time

Idea: I want to perform an operation on all entities available in my system which will have a particular UI and corresponding logic. For example, I want to show details of each record and then user will press next button which will show the next record in that entity.


Solution: As this is required in against each entity so instead of writing the same piece of code again and again in different web screens (for each entity) I thought to implement a Web Logic and re-use it for all the entities as UI and actions(logic) will be same for each entity.


Problem: Following the tutorial, I implemented the move rating web block and re-used it. But in my particular scenario, I'm unable to understand that how can actually pass an entity's aggregate as an input to that web block and how that web block will actually iterate (next - previous controls) on that aggregate?


My Solution: One (stupid) solution which comes to my mind is that I shouldn't use aggregate. I should take an entity's name as an input parameter of web block and should write SQL queries by my own queries for each operation in that web block.


Please suggest a possible way or strategy to achieve this. Or how (if possible) an aggregate can be passed as an input to the web block.


P.S: I've just started working on OutSystem framework (two week) and I've completed the learning course.

Hi,

Best option is to create a generic structure and have an input variable of that structure in web block. In the screen you can query the data, populate local variable of type structure with the aggregate output and then pass the local variable to web block.

Regards.