Microsoft Dynamics 365 Blog

If you are using the SysDateLookup form on a table grid, we please be aware of the following issue.


Unfortunately the selected date on the calendar is incorrect. Instead of showing the date value of the field, the calendar is showing the date value of the last field in the grid. This problem is reproducible in AX 4.0 and AX 2009.


Since this issue is only a display inconsistency, and doesn’t result in data loss or data inconsistency, you can solve this issue with the following workaround.


If you add the line “hostDateControl.valueStr();” just before calling “hostDateControl.dateValue();” in \Forms\SysDateLookup\run it makes the issue go away.


void run()
{

FormDateTimeControl hostDatetimeControl = element.selectTarget();
FormDateControl hostDateControl = element.selectTarget();

int d;
int dayNo;
str 1 dayLetter;
;

if (hostDateControl && classnum(FormDateControl) == classidget(hostDateControl) && hostDateControl.dateValue())

{

// ADD THIS LINE TO WORKAROUND THE PROBLEM
hostDateControl.valueStr();
// END OF WORKAROUND

> initialDate = hostDateControl.dateValue();
(…)


We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!