Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Change Join betweeen Form DataSources

(0) ShareShare
ReportReport
Posted on by 70

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();
        }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans