web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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 87

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

I have the same question (0)
  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

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

  • NeerajSingh Profile Picture
    87 on at

    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.

  • Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi, Check this thread

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

  • NeerajSingh Profile Picture
    87 on at

    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

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    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();
    
            }
        }
    }

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans