Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Want X++ or any setup which can customize the date format to 06-Mar-3023

(0) ShareShare
ReportReport
Posted on by 79

Hi All,

After migration from AX-2012, we came across a situation in which there was a customization in standard date EDT in the format 03-Mar-2023. As we know that in F&O, we can't change the property of the EDT. Can anyone help me, is there any way can achieve this through code extension. Means does anyone know the class or method which does the date formatting so that we can do the extension and change the format. Or If is there any setup through which we can achieve the mentioned date format?

Regards

Neeraj

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 on at
    RE: Want X++ or any setup which can customize the date format to 06-Mar-3023

    Hi Neeraj,

    I wonder if the previous reply was helpful for you. It would be great if you can provide an update.

    As a follow up, I did create (and share) a feature where this requirement can be setup by each user as personalization: More options to personalize the date and time format - Dynamics 365 Finance and Operations - Dynamicspedia

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 on at
    RE: Want X++ or any setup which can customize the date format to 06-Mar-3023

    Hi Neeraj,

    You can't change the date properties of an EDT, also not with an extension. A cumbersome action would be creating your own EDT and make table and form extensions. As you need it for any form, this would be too much of a hassle. I checked for a more generic and easy way to achieve it. You can use the below coding which will change the DateMonth property on runtime. Note that it will consume some additional loading time (milliseconds) when opening forms. In my experience, it isn't a bad experience. I opened the sales order details and released product details without a major impact on performance.

    You might enhance the example for DateTime controls. You can also extend it to get the preference with a new setting on the user options.

    /// 
    /// Extension class subscribing to FormRun delegates.
    /// 
    static public final class DynamicspediaFormRun_Extension
    {
        /// 
        /// Handles date formatting during the initialization of the forms.
        /// 
        [SubscribesTo(classStr(FormRun), staticDelegateStr(FormRun, onFormRun))]
        public static void onFormRunDateFormat(FormRun _formInstance)
        {
            FormControl         formControl;
            FormDateControl     formDateControl;
            List                controlList = new List(Types::AnyType);
    
            controlList = _formInstance.controlList();
    
            ListIterator li = new ListIterator(controlList);
    
            while (li.more())
            {
                formControl = li.value();
    
                if (formControl is FormDateControl)
                {
                    formDateControl = formControl;
                    formDateControl.dateMonth(DateMonth::Short);
                }
    
                li.next();
    
            }
        }
    }

  • NeerajSingh Profile Picture
    NeerajSingh 79 on at
    RE: Want X++ or any setup which can customize the date format to 06-Mar-3023

    Hi Mohit,

    It didn't change my format to 03-Mar-2023. Rather it changed to 03-03-2023, which is not our requirement.

    Regards

    Neeraj

  • Mohit Rampal Profile Picture
    Mohit Rampal 12,552 Super User 2024 Season 1 on at
    RE: Want X++ or any setup which can customize the date format to 06-Mar-3023

    Hi, Check this thread

    community.dynamics.com/.../how-can-i-change-format-all-datetime-to-dd-mm-yy

  • NeerajSingh Profile Picture
    NeerajSingh 79 on at
    RE: Want X++ or any setup which can customize the date format to 06-Mar-3023

    Hi Martin,

    I need this for all the forms. Means for full F&O application. I was thinking, there will be some class or method which would be doing the formatting. If you know any class or method which does this, please let me know. Or else if this can be achieved through the setup, then it will be great.

  • Martin Dráb Profile Picture
    Martin Dráb 230,817 Most Valuable Professional on at
    RE: Want X++ or any setup which can customize the date format to 06-Mar-3023 in D365 Finance and Operation Application.

    Where do you want to change the format? For example, in a single form?

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.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans