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
That only works if the AOT query contains the TempDB Table on the first level. If you add the TempDB Table with an existJoin to a standard table, AX uses a different TempDB Table instance to select the data and the existJoin does not work. This is the same, if you add the TempDB Table dynamically with _query.addDataSource(TableNum(TempDBTable)).
I did not find any way to archive this with an exists join or inner join. You also have no access to the queryRun object to link the tempDB Table later on. Really sad.
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);
Where does the code go ? In the interaction ListPage class ?
Does anyone have sample syntax ?
Thanks, Jim
Hi Parker,
How did you use linkPhysicalTableInstance with this.listPage().activeRecord() ? Or did you used something else. ?
Use the linkPhysicalTableInstance method will solve the problem.
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.
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?
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..
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...
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.
Mohamed Amine Mahmoudi
100
Super User 2025 Season 1
Community Member
48
Zain Mehmood
6
Moderator