Breaking news from around the world
Get the Bing + MSN extension
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2019 release wave 2 Discover the latest updates and new features to Dynamics 365 planned through March 2020
Release overview guides and videos Release Plan | View virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
Suppose we have a table TableA that contains 3 fields A,B and C. This is added to the form Form A which is called from 2 different forms FormX and FormY . The requirement is :
1. If formA is called from FormX the sort order should be C,B then A.
2. If formA is called from FormY the sort order should be A,B then C.
How can this be achieved ?
You can get the caller form name using element.args().caller().name() in init method of your form A.
Then, in the init method of the data source of form A you can set sorting of the data source according to the caller.
Also, consider using an enum parameter on menu items instead of form names. This will allow you (and anybody extending your solution) to reuse the same logic from other places. Also, you won't have to change FormA if you rename FormX or FormY.
From form X and form Y, call form A like this (or call it from a normal menu Item and set the enum parameter values in the same way):
Args args = new Args();
formRun = ClassFactory.formRunClass(args);
sortinEnum = element.args().parmEnum();
Check caller in form Init() using
objects objectCaller = args.caller()
based on caller you can write your sort condition.
Business Applications communities