Announcements
No record found.
Im new to AX2009, we are currently on 3.0. I'm trying to put the Created Date of a Sales Order on a report and just display it as a date. Been looking for some sample code.
*This post is locked for comments
Hi Michelle,
Welcome!
There are a few ways to do this. One without coding anything or you can do it by code.
1. If you have salesTable as a datasource in your query for your report, you can simply drag and drop (MorphX) the createdDate field into a section of your report.
2. Can create a display method like the following
a. If you do have salesTable as a datasource:
display date displaySODate()
{ ;
return salesTable.createdDate;}
b. If you do not have salesTable as a datasource
display date displaySODate(){ return SalesTable::find("YourSONumber").createdDate;}
// Where "YourSONumber" can be set using some variable you get from your query.
Then you have to add a date control to a section of your report and assign the control the data method, which can be set in the controls properties.
Hope this helps.
Kind regards.
Also, check class DateTimeUtil for how to convert createdDateTime to just date. Sry didn't read the subject of your post. :)
DateTimeUtil::date(DateTimeUtil::utcNow());
Not quite sure this is available in 3.0 however...?
Kent
EDIT: Actually I believe createdDateTime field was introduced in AX 2009, so you shouldn't have to convert at all if you are on 3.0...?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Basit 1
GL-01081504-0 1
Roya 1