Wednesday, October 27, 2021

Set Dynamic field property in Dynamic query in D365fo.

Set Dynamic field property in Dynamic query.

    Query query = new Query(); QueryBuildDataSource qbds,qbds1; QueryBuildFieldList fieldList; QueryRun queryRun; VendTable vendTable; DirPartyTable dirPartyTable; ; qbds = query.addDataSource(tableNum(VendTable)); qbds1 = qbds.addDataSource(tableNum(DirPartyTable)); qbds1.relations(True); qbds1.fields().clearFieldList(); fieldList = qbds.fields(); fieldList.addField(fieldNum(DirPartyTable, Name)); fieldList.dynamic(QueryFieldListDynamic::No); queryRun = new QueryRun(query); queryRun.prompt(); while (queryRun.next()) { vendTable = queryRun.GetNo(1); dirPartyTable = queryRun.GetNo(2); }


Keep daxing!!

No comments:

Post a Comment