在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;
}
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;
}