why can't we use generic recordlist in our extensions?

why can't we use generic recordlist in our extensions?


what is the reason we cannot use generic record list as a datatype in our extensions?

either we have to (re)create a recordlist and their structure/entity in the extension.
which means we get a zillion "text" structures, because it's inside Text, custom exensions etc.
or we use the object datatype, but then we have to cast explicitly inside the code, and worse, we have to use ToObject() in out servicestudio, which means pissible runtime errors.

Hi Joost,

Since we make our interfaces with Extensions follow the same type limitations that we have all across the platform, adding Generic Record Lists to extensions would pretty much require us to support it across the whole platform.

The problem is that supporting Generic types is a fairly complicated thing in general terms: there would be severe impact on all generated code and type checking, serializing to Web Service calls, concrete casting so that things could be inserted into database etc.

I share your feelings on the usefulness of this, but so far we haven't been able to come up with a solution that wouldn't feel like a clunky hack and produce more problems than it solves...


Still no solution for this? :-/
Hi Tomas,

What are you trying to achieve?
We might not have generic types on extensions but is still possible to cast any kind to an object.

Take a look at this example: http://www.outsystems.com/forge/22/sortrecordlist/ 
This is a generic function to sort record lists of any kind.

Let us know if you have any problem.



I wanted to make an Action, which would have RecordList as an input parameter, and the action would iterate over this list and delete all rows. For any recordlist.
Thought it won't be that much of a hack. But if it is not possible to it the 'OOP' way, I can live with that.

Thank you.

Hi again Tomas,

You have a set of generic built in actions to solve the most common operations with lists.
To simply delete all the elements from a List you can use the ListClear Action.

If you don't see it, go to "Add/Remove References" and check the missing system action.

Will this solve your problem?


Perfect! Thank you!