End of mainstream support for Microsoft Dynamics AX 2009, 2012, and 2012Mainstream support for Dynamics AX 2009 Service Pack 1 (SP1), Dynamics AX 2012, and Dynamics AX 2012 R2 ended Oct. 9, 2018. After that date, only security hotfixes will be provided for these three versions through the extended support period that until Oct. 12, 2021. Read more
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
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 and Operations TechTalks | Customer Engagement TechTalks | Talent 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