Generate a re-usable screen action or user action for populating a list page or detail page upon first creation of the list page?

By Matt Q on 2 May
Hi,
Would it be possible for OutSystems to generate a re-usable screen action or user action for populating a list page or detail page upon first creation of the list page?
 
If so, could an upgrade tool also be provided in a future version?
 
If not, what are some best practice alternatives for code reuse or what might be the challenges in implementing such reuse at the time of list page generation?
 
Thanks,
Matt
Not sure I understand this one?

J.?Ja
J.3 May
As Justin, not sure what you mean?

Matt Q3 May
Suppose I've created a List page with intelliwarp.  Then I create a Detail page with intelliwarp.  I would like the List page to have generated a screen or user action that will be reused by both the List page and the Detail page.  This would allow developers to add any special logic that's necessary to that reusable action, rather than in SQL and rather than having to copy/paste in up to 3 places: the List page preparation, the RefreshTable action, and in the Detail page preparation.
What Action would be common to both the List and the Detail page that Intelliwarp would be generating? There is no logic common to both pages by default that I can think of.

J.?Ja
Matt Q4 May
Sure, currently the List and Detail page are not related by OutSystems.  I usually end up modifying the queries to be like this:

SELECT      {Product}.*,
            {Cost}.*
 
FROM        {Product}
JOIN   {Cost}
ON {Product}.[Id] = {Cost}.[ProductId]
 
WHERE       {Cost}.[ProductId] = @ProductId
OR {Product}.[ProdNum] LIKE '%' + @SearchKeyword + '%'

By the way, this is a simplification of a real-world example that also joins to many other tables used to read data from an external system.  The List Page allows searching by product number.  The Detail Page will always search by ProductId.

When Intelliwarping the List page, it would be helpful if OutSystems generated an Action with some SQL like this (and then we can manually edit afterwards to be like above):

SELECT      {Cost}.*
 
FROM        {Cost}
 
WHERE       @CostId IS NULL OR {Cost}.[Id] = @CostId

Not looking for it to automatically be like top SQL, just looking for an Action to allow for reuse of our manual modifications to the query.
By implementing something like that, you would actually lose all the optimization the platform does regarding aggregates and simple queries. It is actually described as not being a good practice.
https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/Performance_Best_Practices/Performance_Best_Practices_-_Queries#Avoid_using_isolated_simple_queries
Matt Q9 May
The alternative we have to do currently is to copy-paste the query in about 3 places: the List page preparation, the RefreshTable action, and in the Detail page preparation.

There can sometimes be loops after the query (within Outsystems) to process the data.  Hopefully the loop can be in 1 place, but sometimes it may need to be copy-pasted as well.

This may work well for admin pages, but without somewhere to put reusable non-trivial data retrieval, maintaining pages with higher business value than simple admin pages is more error-prone.

Are there any plans to include Action output entity/attribute usage in the optimizer?  That would seem to pave the way for reusable actions that load screens with data.

Thanks,
Matt