Hi Everyone,
I am trying to convert the following query into QueryBuildDataSource :-
while select * from inventTrans
join inventDim
where inventTrans.inventDimId == inventDim.InventDimId
join inventBatch
where inventBatch.InventBatchId == inventDim.InventBatchId
&& inventBatch.itemId == inventTrans.ItemId
Like This :-
qbdsInventTrans = query.addDataSource(tableNum(InventTrans));
qbdsinventDim = qbdsInventTrans.addDataSource(tableNum(InventDim));
qbdsinventDim.relations(false);
qbdsinventDim.fetchMode(JoinMode::InnerJoin);
qbdsinventDim.addLink(fieldNum(InventTrans,inventDimId),fieldNum(InventDim,InventDimId));
qbdsInventBatch = qbdsinventDim.addDataSource(tableNum(InventBatch));
qbdsInventBatch.relations(false);
qbdsInventBatch.fetchMode(JoinMode::InnerJoin);
qbdsInventBatch.addLink(fieldNum(InventDim,inventBatchId),fieldNum(InventBatch,inventBatchId));
qbdsInventBatch.addLink(fieldNum(InventTrans,ItemId),fieldNum(InventBatch,itemId));
But in the line qbdsInventBatch.addLink(fieldNum(InventTrans,ItemId),fieldNum(InventBatch,itemId)) it is showing the exception " Invalid Field/Related field combination. "
How to resolve this ??
Thanks