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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Display Current Date field on form D365 F&O

(0) ShareShare
ReportReport
Posted on by

Hello Guys , I have a custom form and i have create a date field. i want this date field to show the current date and should not be editable by user. for prevent editing i made allow property as "NO" but how to display current date by default when user will enter the data in the form.

my side i set Auto declaration property "YES" and Date Value "Today's date" but still its not displaying any date. i believe this is simple task can be setup by changing property or we require coding for this ??.

Please find the screen shot below.

1.Date field on form

   Error63.PNG

2.Date Field Properties 

Error64.PNG

I have the same question (1)
  • Community Member Profile Picture
    on at
    RE: Display Current Date field on form D365 F&O

    Hello Vinit ,

    This is exactly what i want and its working fine. Thank you so much for the help.

    also Thanking Gunjan, Martin and  Blue for there suggestions and kindness.

    Have a great day !!!

  • Verified answer
    vinitgoyal2005 Profile Picture
    6,332 on at
    RE: Display Current Date field on form D365 F&O

    Hi,

    I assume you want to populate this date with the current date when a new record is created in 'DRFProjectTable'. What you need to do is write code in initValue method of the table like below:

    public void initValue()
    {
        super();
        this.DateRequested = DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone());
    }

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Display Current Date field on form D365 F&O

    Hi Sachin,

    In that case, you should initialize the value of this field in "initValue" method in the table. Override the initValue method and add this code -

    this.DateRequested = systemDateGet();

  • Suggested answer
    Martin Dráb Profile Picture
    235,876 Most Valuable Professional on at
    RE: Display Current Date field on form D365 F&O

    If you want to initialize the field when creating a record, use initValue() method on the table.

    By the way, if you have a control bound to a table field, never try to change the value of the individual control. You should change the table buffer instead.

  • Community Member Profile Picture
    on at
    RE: Display Current Date field on form D365 F&O

    Hello Gunjan ,

    I am sorry i did not explain properly Please find my comments below related to this customization.

    Requirement  : When user will create record on this form , DateRequested field should display that current date ,this date will be fixed and store in database.

    purpose : I want to track user when he raised this form record , so in future i will calculate how many days he took to complete the process. There is one more date date completed. which user will fill when the process will be complete.

    I hope i mentioned clearly , please let me know if you need more clarity.

  • Blue Wang Profile Picture
    on at
    RE: Display Current Date field on form D365 F&O

    Hi Sachin,

    If you just want to display the current time on the form, write a display method to act on your control.

    Or you can refresh the update time in time,Please check this blog:

    community.dynamics.com/.../ax-7-using-timer-to-perform-a-periodic-task

  • Gunjan Bhattachayya Profile Picture
    35,421 on at
    RE: Display Current Date field on form D365 F&O

    Hi Sachin,

    In case you always want to show today's date in this field,. why are you creating a field in the table? You can create a display method to show today's date. But what is the purpose for this customization? Do you have to show today's date always or fill in today's date into this field while creating a new record?

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 745 User Group Leader

#2
Martin Dráb Profile Picture

Martin Dráb 597 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans