如何从 ax 2012 中的 AOT 查询中获取表

How to get the tables from AOT query in ax 2012

我在一页中有下拉菜单,我在第一页中选择 AOT 查询然后我将单击下一步按钮,然后它必须显示与该查询相关的表

如果您有查询名称,则可以像这样遍历其所有数据源:

str queryName = "ActivityListOpen";
int i, dbcount;
QueryBuildDataSource qbds;
Query query = new Query(queryName);
dbcount = query.dataSourceCount();

for (i = 1;  i <= dbcount; i++)
{
    qbds = query.dataSourceNo(i);
    info(qbds.name());
}

您还可以在 QueryBuildDataSource 上使用 table() 方法来检索 table Id。