Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Workaround for subqueries for a Form ListPage AX2012

(0) ShareShare
ReportReport
Posted on by 44

Hi all,

I need a hand with this please,

I am trying to show 10 productions' Route Operations per each started production in a form listpage. So my plan is to convert this Form List Page that I have created in AOT. (which is showing all prodRoute vertically)

pastedimage1623062187453v1.pngpastedimage1623064040376v3.png

into this: one row per started production, with 10 first operations in columns (Horizontally)

pastedimage1623062339382v2.png

In my head thinking in SQL I would make this using a sub query per each Group of fields but I cannot translate that into AX in AOT.

The cool part of using the ax listpage is that I can use the prebuilt Display Method from each table.

What would be a efficient way to build this??

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,735 Super User 2024 Season 2 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    Hi Nestor,

    A temporary table is possible, however, it would take computing and database read times to prepare all data. It will be also slower compared to your Started Productions ListPage. If the current load time of the form with computed columns is too slow, you can try to fetch only used fields from the ProdTable or indeed have a look at using a temporary table.

    There are multiple examples in the application where a temporary table is used. One example is the Organization hierarchy purposes form which build a temp table and shows it on the list grid.

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    Interesting Never worked with tempDB for a form just a simple business logic for a report only.

    You think it will Make it faster with TempDB?.

    I just wonder how will you Populate it with . Only with ProdId? and then the rest with Display Methods Fields?... wonder if that worth the try

    I think you were right. I have finally made by hand the whole 10 operations groups (50 computedColumns total)

    And I can see that after the 6th group the performance is decreasing as well as filtering and sorting  inside form.

    I am pulling only 231 records . In time Comparison the Started Productions ListPage is 30% faster than mine.  I really wonder is worth the effort to start looking on the Temporary table solution Or is just the amount of columns displayed that is forcing the Client to be slow...

  • ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    But as I said before, I never build nearly the entire form(view) with computedColumns, although I used it occasionally. I will use more if there is no performance issue. (They are pretty easy and useful)

  • ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    I don't know about the demand, but I would probably do it with tempTable. It seems that something can be done with queries and views as well. Finally, Display fields, dynamic fields etc.

    If they don't accept those, I would say let's make a different tab :)

    If they did not accept this suggestion too, I think I would direct them to the reports.

    I think the corruption is caused by the Column width

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    Hi Ergün,

    even though I am still interested in a different solution. To be honest I don't know other

    by the way you know how to hide the pane that is behind the FactBoxes ( is not exactly the Parts Pane)

    pastedimage1623323810798v1.png

    edit: got it. Grid properties -> width: Column width

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,735 Super User 2024 Season 2 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    The advantage of using T-SQL in computed columns is that the execution is done on the SQL server.

  • ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    A finished form is always best. (There are easier ways, but it is difficult to say that they are better.)

    I would avoid using ComputedColumn if possible but it's a bit of a reflexive move. It has no fundamental basis. (I feel like it's going to slow down.)

    I have never used it this way, but if there is no slowness due to data, I think it is ok

  • Suggested answer
    CBNestor Profile Picture
    CBNestor 44 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    Hi Ergün,

    The Speed is the same as a regular ListPage form (prodTableListPage for example). So Is good

    Every Column (except for the ProdTable) are ComputedColumn once I did it for the first group I just need to duplicated the methods and the Fields and changing the name and I got it.

    here the structure if you are interested. 

    If you know a better solution please let me know

    pastedimage1623249708105v1.png

  • ergun sahin Profile Picture
    ergun sahin 8,812 Super User 2024 Season 1 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    I understood what you were trying to do when I saw the result. (In fact, if you look carefully, you can understand it in the first picture. I probably didn't have the time when I first saw it)

    How is the speed of the final version of the form?(It seemed a little slow but not sure)

    I think there are easier ways but I'd be lying if I said I don't curious about the structure or your codes.

  • CBNestor Profile Picture
    CBNestor 44 on at
    RE: Workaround for subqueries for a Form ListPage AX2012

    Hi André,

    It is almost done know. It really helped the explanation of subqueries from Martin It was exactly what I needed!

    pastedimage1623247575915v2.png

    Just a liitle bit tedious to built all by hand I have to find a way to generate the objects by x++ 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans