SELECT * FROM SalesTable(SalesTable_1)
JOIN * FROM SalesLine(SalesLine_1)
ON SalesTable.SalesId = SalesLine.SalesId
JOIN * FROM CustTable(CustTable_1)
ON SalesTable.CustAccount = CustTable.AccountNum
Query query = new Query();
QueryBuildDataSource salesTableDS;
QueryBuildDataSource salesLineDS;
QueryBuildDataSource custTableDS;
salesTableDS = query.addDataSource(tableNum(SalesTable));
salesLineDS = salesTableDS.addDataSource(tableNum(SalesLine));
salesLineDS.relations(true);
salesLineDS.fetchMode(QueryFetchMode::One2One);
custTableDS = salesTableDS.addDataSource(tableNum(CustTable));
custTableDS.relations(false);
custTableDS.addLink(fieldNum(SalesTable, CustAccount), fieldNum(CustTable, AccountNum));
custTableDS.fetchMode(QueryFetchMode::One2One);
info(salesTableDS.toString());
Komentar
Posting Komentar