Skip to main content

Posts

Showing posts from April, 2014

Dynamics AX 2012 ValidTimeState tables and form changing view from current to all

Valid Time State tables are new i AX 2012 a gives the developer the possibility to easily create tables that hold e.g. current setup data for various purposes, and at the same time keeping a "history" of the changes of the data in the table. For more reading: http://msdn.microsoft.com/en-us/library/gg861781.aspx I was tasked with doing a setup table with rates for calculating Vendor Bonus and I chose to base this a valid time state table. The customer asked for a button on the form, where you maintain the vendor bonus calculation setup data, so you could toggle viewing "Current setup" or "All setup" records (changing the view from actual to all records and vice versa in the form). I found that you can not change the ValidTimeStateAutoQuery property on the form data source in a form at run-time. It simply does not change anything, so I came up with the following solution: A boolean class member in the classdeclation method of the form: boolean ...