Date formats in Dynamics AX can be a bit of a challenge. There are a few different locations to manage date formats. Any modifications made to each location can lead to an entirely different result.
- System and user language
The system language is used to define the default language when creating new records in AX. Examples of records that default from the system language parameter are vendors, customers, organizations and users. Languages define the format that will be used for date, time, and currency in the system and reporting.
When a new user is created, their Language setting (set under the users > user account > options dialog) will default to the value specified in the System language parameter.
As such, if the system language is set to EN-CA (for Canada), a newly created user will see dates as dd/MM/yyyy. By changing the user's language to EN-US (for USA), that same user will now see dates as MM/dd/yyyy.
- Report language
The report language parameter set in Visual Studio for a given report can be change to alter the display format of date, time, and currency. As with user language, each language is tied to a specific date, time, and currency format.
- Control specific formats
Controls, such as text boxes, can have specific formats set to display dates as desired. To apply formatting to a given control, right click the field and view the field's properties.
- Using expressions to get exact values
Expressions can be used to display a field as desired. For example, if you are only concerned with the month of a given field, you can use the expression =Month(fields!transdate.value) to show only the month. Using expressions allows you to do significantly more with date fields.
No comments:
Post a Comment