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, ...
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)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    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?

  • Blue Wang Profile Picture
    on at

    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

  • Community Member Profile Picture
    on at

    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.

  • Suggested answer
    Martin Dráb Profile Picture
    237,965 Most Valuable Professional on at

    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.

  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

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

  • Verified answer
    vinitgoyal2005 Profile Picture
    6,332 on at

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

  • Community Member Profile Picture
    on at

    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 !!!

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 551 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans