The views and opinions expressed in this blog are those solely of the author(s) and do not necessarily reflect Microsoft’s current policy, position, or branding. For official announcements and guidance on Dynamics 365 apps and services, please visit the Microsoft Dynamics 365 Blog.
Personalized Community is here!
Quickly customize your community to find the content you seek.
Now Available in Community - New TechTalk Videos for 2020
Read More about New TechTalks for 2020
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 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 | Upcoming TechTalks
Sorting data on grid of form in Microsoft Dynamics 365 for Finance and Operations and Microsoft Dynamics AX 2012 can be done through the form. But every time you have to do it whenever you will open the form. To sort the data on grid of form in D365FO whenever form is opened can be achieved using extension approach of development.
I have shared the article in which I have described How to sort data on grid of form in Microsoft Dynamics AX 2012 using X++. But, in Microsoft Dynamics 365 for Finance and Operations, it is different as you have to use the events and extension approach instead of directly over layering the code of the Microsoft.
If you read my article about how to sort data on grid of form in Microsoft Dynamics AX 2012 using X++, you will come to know the prerequisites. Only the difference is writing the code. In D365FO, we have to create an extension class and copy the event handler method of OnInitialized event of the data source and paste the event handler method in the class. And then writing the two lines of code.
Before starting the customization about how to sort data on grid of form in D365FO, you need to know the names of the following elements you are going to use:
This above table is already described in the article: How to sort data on grid of form in Microsoft Dynamics AX 2012 using X++.
In my case, I am using the following elements as I have already used them in AX 2012:
Till now, all the things are same as I have done in the Microsoft Dynamics AX 2012. From now onward, the customization is different from AX 2012.
To implement the solution to sort data on grid of form in D365FO, follow these steps:
//Moeen Ahmed Sultan
//It will clear if any other sorting is applied on the grid
//It will add the sorting on the field
//Use the table and field as per your own requirement in fieldNum function.
//Use the ascending or descending order as per your own requirement
Using the extension approach, creating a class and pasting the event handler and adding the two lines of code, you will be able to get the sorted data when the form is opened. In this way, you will achieve your requirement that is to sort data on grid of form in D365FO.
Blog: Click here
YouTube: Click here
GitHub: Click here
If you found any ambiguity or better solution, please let me know. If this helps you, please like, comment and share.
Don’t let mistakes and disappointments of the past control and direct your future. – Zig Ziglar
The post How to sort data on grid of form in D365FO using X++ appeared first on NevoiTech Blog.
Business Applications communities