Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 143529

How to add link to the parent of parent Datasource in QueryBuildDataSource?

$
0
0

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


Viewing all articles
Browse latest Browse all 143529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>