10 Ekim 2013 Perşembe

AXAPTA - Join table A with table B and table A with table C

I can do this with a way which I got from a forum forumda . Trick is fetchMode command. Without fetchMode command can't generate a correct select command. 
Query query = new Query();
QueryBuildDataSource qbds,qbds1,qbds2;
;
qbds = query.addDataSource(tableNum(SMAServiceOrderTable));
qbds1 = qbds.addDataSource(tableNum(B_RepairJournal));
qbds1.fetchMode(QueryFetchMode::One2One);
qbds1.addLink(fieldNum(B_RepairJournal,ServiceOrderId),fieldNum(SMSServiceOrderTable,ServiceOrderId));
qbds2 = qbds.addDataSource(tableNum(InventTable));
qbds2.fetchMode(QueryFetchMode::One2One);
qbds2.addLink(fieldNum(SMAServiceOrderTable,ItemId),fieldNum(InventTable,ItemId));

info(qbds.toString());

Hiç yorum yok:

Yorum Gönder