Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 72043

How to set the relation of data source using query?

$
0
0

Hello, 

I have 2 tables, salesTable and custPackingSlipTrans. 

How do I set the relation of datasource to the relation salesTable.salesId == CustPackingSlipTrans.OrigSalesId?

I tried the ff code below but it does not get the relations I need. 

query = new Query();
qbds = query.addDataSource(tableNum(SalesTable));

qbds = qbds.addDataSource(tableNum(CustPackingSlipTrans));
qbds.relations(true);

 info(query.dataSourceNo(1).toString());

This returns the query as 

"SELECT * FROM SalesTable JOIN * FROM CustPackingSlipTrans ON SalesTable.SalesId = CustPackingSlipTrans.SalesId"


Viewing all articles
Browse latest Browse all 72043

Trending Articles



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