Tag: DateTimeUtil

  • Dynamics Ax 2009 using the DateTimeUtil

    Since i’m getting a lot of google hits on my Dynamics Ax – workdays to days post, i’ve decided to blog some more about it. The DateTimeUtil class is actually a wrapper of the .NET DateTime class. A first thing to remember when using UtcDateTime EDT’s is that it is stored like the name says…

  • Dynamics Ax modifying CreatedDateTime

    For testing purposes with the MRP we needed to modify the createdDateTime fields in Dynamics Ax 2009. Since these are system fields we needed a workaround. if(isRunningOnServer() && CurUserId() == “Admin”) { new OverwriteSystemfieldsPermission().assert(); salesLine.overwriteSystemfields(true); // “YYYY/MM/DD HH:MM:SS” salesLine.(fieldnum(SalesTable,CreatedDateTime)) = str2datetime( “2010/04/03 11:00:00” ,321 ); salesLine.doInsert(); salesLine.overwriteSystemfields(false); CodeAccessPermission::revertAssert(); } Remarks: Since this code is pretty…

  • Dynamics Ax workdays to days

    Ever had to calculate the number of days starting from a number of workdays and even deal with holidays.A pretty straightforward example using the DateTimeUtil class and DayOfWk method.