在bc中使用QueryRun

AxaptaObject axQuery = ax.CreateAxaptaObject("Query");
AxaptaObject axQueryBuildDataSource1 =
axQuery.Call("addDataSource", 175) as AxaptaObject;

AxaptaObject axQueryBuildDataSource2 =
axQueryBuildDataSource1.Call("addDataSource", 176) as AxaptaObject;
axQueryBuildDataSource2.Call("relations", true);

AxaptaObject axQueryRun = ax.CreateAxaptaObject("QueryRun",
axQuery);

AxaptaRecord itemRecords = ax.CreateAxaptaRecord("InventTable");
AxaptaRecord moduleRecords =
ax.CreateAxaptaRecord("InventTableModule");

while ((bool)axQueryRun.Call("next"))
{
itemRecords = axQueryRun.Call("get",
itemRecords.get_Field("TableId")) as AxaptaRecord;

moduleRecords = axQueryRun.Call("get",
moduleRecords.get_Field("TableId")) as AxaptaRecord;
}
posted @ 2013-10-10 11:50  perock  阅读(471)  评论(0编辑  收藏  举报