Announcements
Hi Every One ,
I have a requirement to change a join between two data Sources on Radio button in D365 Custom Form So for that i created my query in DataSource init method and trying to change their join on Execute Query method but that doesn't works . My query is getting build according to my requirement but join is not getting applied in execute query.
any one can help out on that to achieve that ?
public void init() { super(); Query query =MyTable1_ds.query(); QueryBuildDataSource qbds; qbds =query.dataSourceTable(tableNum(MyTable1)).addDataSource(tableNum(MyTable2)); qbds.clearLinks(); qbds.addLink(fieldNum(MyTable1, DistributionID), fieldNum(MyTable2, DistributionID)); qbds.joinMode(JoinMode::ExistsJoin); qbds.relations(false); } public void executeQuery() { Query query= MyTable1_ds.query(); switch(PaymentDistributions.selection()) { case PaymentDistributions::DistributedPayments : query.DataSourceTable(tableNum(MyTable1).joinMode(JoinMode::ExistsJoin); break; case PaymentDistributions::NonDistributedPayments : query.DataSourceTable(tableNum(MyTable1).joinMode(JoinMode::NoExistsJoin); break; case PaymentDistributions::AllProcessedAllocation : query.DataSourceTable(tableNum(MyTable1).joinMode(JoinMode::OuterJoin); break; } super(); }
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156