Today I will demonstrate you that how to use QueryBuildLink Class in AX. static void querybuildlink_example(Args _args) { Query query = new Query(); QueryBuildDataSource custTableQBDS, custTransQBDS; QueryBuildRange qbr1; QueryBuildFieldList qbFl, qbF2, qbF3; QueryBuildLink qbl; QueryRun qr; CustTable custTable; CustTrans custTrans; custTableQBDS = query.addDataSource(tablenum(custTable)); custTableQBDS.fields().dynamic(NoYes::No); qbFl = custTableQBDS.fields().addField(fieldNum(CustTable, AccountNum)); qbF2 = custTableQBDS.fields().addField(fieldNum(CustTable, InvoiceAccount)); qbF3 = custTableQBDS.fields().addField(fieldNum(CustTable, CustGroup)); qbr1 = query.dataSourceTable(tableNum(CustTable)).addRange(fieldNum(CustTable, AccountNum)); qbr1.value(SysQuery::value('1102')); custTransQBDS = custTableQBDS.addDataSource(tableNum(CustTrans)); custTransQBDS.relations(true); qbl = custTransQB