Two (or more) temp datasources with parent-child relationship on form (AX 4.0)


I have to add some aggregated detail information (another grid) to a form that is based on a temporary table.The first temporary table (grid) is populated during init()-method of the form. The data for the second grid will also come from a temporary table but I do not know when to populate this second temporary table.

How can I achieve that the second grid only shows the data related to the selected record from the first grid and the second temporary table is filled? I thought about JoinType “Delayed” on the second form datasource (and join it to the first) but this seems not to work with temporary tables.

Hopefully I did describe it the right way to understand. You can imagine like the standard SalesTable form but having the SalesTable as well as the SalesLine datasource as temporary tables.

Thanks in advance for any help!

Hi Boris, welcome to Dynamics User Group.

Delayed links work with temporary tables as well as with persistent tables. It definitely works for me in AX 2012 and I believe it’s been working the same for ever.

You said that you don’t know when to populate this second temporary table and the answer is: as soon as you can. If you know the data in when running init(), then do it in init(). If you can’t generate the data before selecting a parent record, you’ll have to do it in active().

Hi Martin,

thanks for welcoming me and thanks for your suggestion.

So, I will have to populate the second temporary table also in the init() method of the form? I know the data at that time already but I was not sure why I should populate the table with all details and later on show only the ones from the record selected in the first temp table. I thought there has to be a more performant way to do it (since I would populate a lot of information which the user may even not see).

So nothing else, only populate and join by delayed JoinType?



If you use normal tables, you also have all data from the beginning and leave all filtering to dynalinks.

You surely can generate data on request, or do anything else that you’re able to develop. What’s the best depends on situation - users often prefer waiting a while on the beginning (showing a progress bar helps a lot) and then use the form smoothly, rather than waiting each time they switch records.

In either case, you first have to decide what you’re going to implement before starting.

Hi Martin,

sorry for the late response, this project was postponed so I had no chance to check in between.

What I did so far: I added the second temporary table with linktype “Delayed” and joinsource the first temp table as second datasource to the table, i.e. there should be a parent child relationship. Furthermore, I do populate both tables in init() method (and when I check with the debugger, this works also).

The problem I am still facing is that no data is displayed in the second grid (i.e. the data from the second temp table). What do I miss?

I am wondering if I have to define somewhere the link relation between those two tables. I did set up a relation in Data Dictionary / Tables on the second temp table declaring the field to join. However, this does not work (and maybe this is not even the root cause why there is no data shown in the second grid).

Do you have any ideas?


Best regards,


There are so many explanations, such as:

  • the query is fine and the datasource displayed correctly, but you have a problem in filling the data
  • the query is fine and you’re filling data correctly, but you’re not displaying it correctly in the form
  • data is filled and displayed correctly, but you have a problem with the query

You have to do more work to narrow the question.

For example, if you switch the table to a persistent one, you might find that the problem isn’t related to temporary tables.

If you suspect that your query / relation doesn’t work, loot at the query string you’ve generated. It will give you more information than “does not work”.