Hi,
I have been trying to create a query where I am grouping it by item id from invent trans and batch id from inventDim. Now, when I try to get the table buffer of invent Dim, it is empty with no batch it present in it. Please help me with it.
</
qbds= query.addDataSource(tableNum(InventTrans));
qbdsInventDim = qbds.addDataSource(tableNum(InventDim));
qbdsInventDim.relations(true);
qbds.fetchMode(QueryFetchMode::One2One);
qbdsInventTable = qbds.addDataSource(tableNum(InventTable));
qbdsInventTable.relations(true);
qbds.fetchMode(QueryFetchMode::One2One);
qbdsEcoResCategory = qbdsInventTable.addDataSource(tableNum(EcoResProductCategory));
qbdsEcoResCategory.relations(true);
qbdsEcoResColor = qbdsInventDim.addDataSource(tableNum(EcoResColor));
qbdsEcoResColor.relations(true);
qbdsDSRCode = qbdsEcoResColor.addDataSource(tableNum(SLD_DSRCodeSetup));
qbdsDSRCode.relations(true);
qbds.addGroupByField(FieldNum(InventTrans, ItemId));
qbdsInventDim.addGroupByField(fieldNum(InventDim, InventBatchId));
queryRun = new QueryRun(query);
while(queryRun.next())
{
inventTransQuery = queryRun.get(tablenum(InventTrans));
InventDimQuery = queryRun.get(tablenum(InventDim)); // this line gives nothing in the buffer
}
/>