join a table with 2 tables

i want to join a table with 2 tables in x++ using qbds

for ex. i want to join sales table with salesline table and hcmworker table

And what’s the problem?

actually i am confused about the sequence i have to write for these joins… i want to make inner join with both tables so can i have that or it will ignore one join out of two ?

It’s rather simple:

Query q = new Query();
QueryBuildDataSource headerDs = q.addDataSource(tableNum(SalesTable));
QueryBuildDataSource lineDs   = headerDs.addDataSource(tableNum(SalesLine));
QueryBuildDataSource workerDs = headerDs.addDataSource(tableNum(HcmWorker));
// and some additional code to define relations

q = new Query();

qbds = q.addDataSource(tableNum(inventTrans));


qbr = qbds.addRange(fieldNum(inventTrans,ItemId));

qbds = qbds.adddatasource(tableNum(InventDim));