![]() |
#11 |
NavAx
|
Цитата:
X++: static void edd_testUserConnection(Args _args) { UserConnection userConnection; InventTable inventTable; InventSum inventSum; Query query; QueryBuildDataSource qbds; QueryBuildRange qdr; QueryRun queryRun; boolean useAlterConnection = true; int i; ; query = new Query(); qbds = query.addDataSource(tableNum(InventSum)); qdr = qbds.addRange(fieldNum(InventSum, ItemId)); qbds.addSelectionField(fieldNum(InventSum, PhysicalInvent), SelectionField::Sum); qbds.addSortField(fieldNum(InventSum, ItemId)); qbds.orderMode(OrderMode::GroupBy); if (useAlterConnection) { userConnection = new UserConnection(); inventSum.setConnection(userConnection); } while select inventTable { i++; qdr.value(queryValue(inventTable.ItemId)); queryRun = new QueryRun(query); queryRun.setCursor(inventSum); queryRun.next(); inventSum = queryRun.getNo(1); info(strfmt("%1: %2", inventTable.ItemId, inventSum.PhysicalInvent)); sleep(1000); if (i >= 20) { break; } } } |
|