Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
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
Want to compare two fields of a table and throw validation message if first date field is greater than the second date field. Where and what will be the code to do so.
I have written this code on form level but its not working.
What exactly do you mean by "its not working"?
We can't help you if you don't tell us what problem you're dealing with.
Your code has two problems:
1) In the event handler you declare salesTable but don't assign any value to it. So it's comparing the field values within an empty table buffer (where both dates are obviously empty).
2) You are adding event handler methods to an augmentation class (extensionOf). You should separate class augmentation and event handlers in two separate classes. https://daxmusings.codecrib.com/2018/06/accidental-code-extensions.html
I also recommend putting your code in the validateWrite method / event of the table. Otherwise it will only work on this form but anyone entering data via some other channel (such as Excel) will pass this validation.
Your salestable buffer is empty , you have to get it from sender . See below .
FormDataSource inventTransferLine_ds = sender.datasource();
Business Applications communities