web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

TempDB table in List page

(0) ShareShare
ReportReport
Posted on by

Hi all,

I want to create a list page with a tempDB table as data source. But I don't know how to insert data to this data source.

insert_recordSet tmpTable (fields) tmpTable select (fields) from table; I put some code in interaction class, so how to get the data source object?

this.listPage().activeRecord(); is incorrect.

Welcome any advices.

Thanks,

Parker

*This post is locked for comments

I have the same question (0)
  • Verified answer
    André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Parker,

    I have not done it with list pages and the interaction class, but usually you can use the command queryrun.setCursor(tempTable)  to put the data into a query.

  • ParkerPeng Profile Picture
    on at

    Thank you.

    I need to generate these records before the list page was ran. I put some new code as below, but the performance is so bad.

    ListPage/init()

    {

       super();

       insert_recordset tempTable

    (InventTransId, OrderRecId)

    select InventTransId, maxOf(RecId) from wmsOrder

               group by InventTransId;

    }

    Do you have any advices? Very thanks.

  • André Arnaud de Calavon Profile Picture
    301,035 Super User 2025 Season 2 on at

    Hi Parker,

    What are you trying to achieve? Is the OrderRecId and the RecId the same? The calculation in the query is time consuming. You could create an index on InventTransId, RecId and see if this helps.

    But I wonder... if you share the requierement, probably there might be another possibility...

  • ParkerPeng Profile Picture
    on at

    I was use the form data source to call the insert_recordSet, so it calls so many RDPs.

    My requierement is change a query that provide data source for a list page:

    SalesLine join WMSOrderTable, we just need the last created output order.

    The SQL like below(cannot achieve)

    while select salesLine

       order by wmsOrder.RecId desc

       join firstonly wmsOrder

           where wmsOrder.InventTransId == SalesLine.InventTransId

    {

       ......

    }

    I cannot call the while... insert, because the data is vast..

  • Rachit Profile Picture
    4,015 User Group Leader on at

    Hi Parker,

    Can you try by creating a view, add it to a query and then use it to populate your list page, instead of using temp tables and see if that solves your problem.

    It would be interesting to know more about the requirement and reason on why you choose to use temp table on a list page?

  • ParkerPeng Profile Picture
    on at

    Thank you Rachit Garg, I was try  to create a view, but it seems more slow than generates data to data source.

    My customer need to create a list page to scan data. And they also need to get the newest output order of a salesLine, display the WMSOrderTrans.expeditionStatus to form grid.

    So, I want to create a view or generate data to temp table by:

    select maxof(Recid) from wmsOrder group by wmsOrder.inventTransId. Use the maxOf(Recid) to filter the wmsOrder table.

  • Verified answer
    ParkerPeng Profile Picture
    on at

    Use the linkPhysicalTableInstance method will solve the problem.

  • Jonathancm Profile Picture
    416 on at

    Hi Parker,

    How did you use linkPhysicalTableInstance with this.listPage().activeRecord() ? Or did you used something else. ?

  • Jim Bonnie Profile Picture
    60 on at

    Where does the code go ? In the interaction ListPage class ?

    Does anyone have sample syntax ?

    Thanks, Jim

  • Jonathancm Profile Picture
    416 on at

    yes, in the interaction class...

    Example:

    initializeQuery method:

    tmpTransLocal = this.listPage().activeRecord(queryDataSourceStr(MyQuery, mytempTable)); //This sections throws and error on EP: "Object reference not set to an instance of an object." In desktop client works OK.

    tmpTrans = this.fillTable(tmpTrans,account,fromDate,toDate);

    super(_query);

    tmpTransLocal.linkPhysicalTableInstance(tmpTrans);

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans