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 :
Microsoft Dynamics AX (Archived)

How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

(0) ShareShare
ReportReport
Posted on by 578

Hello !

How can I hide the value in a grid if the date is minvalue type (1900-01-01)

Currently showing 12:00:00 and I need you to show nothing.

Thanks

*This post is locked for comments

I have the same question (0)
  • Stefan Hofmaninger Profile Picture
    520 on at

    Hi,

    if your field is from type UtcDateTime the minimum value is '1900-01-01T00:00:00'. Check which value is in stored in the field -> if the value is '1900-01-01T12:00:00' you have found the problem.

    You can set the value to null by using following method:

    utcDateTimeNull()

    Regards,

    Stefan

  • ismaelivan Profile Picture
    578 on at

    Hello Stefan, I add the utcdatetime field to the table, and it was inserted with that date by default 1900-01-01 12:00:00. I also create a second column with the name + tzid

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Could you let us know the EDT that you are using on your DateTime field.
    As, when I used SysDateTime EDT I am able to get blank value on form and table and

    on the backend it stores as "1900-01-01 00:00:00.000".

    If it's a custom field you can change its EDT to SysDateTime and check.

    Refer screen shot below(Colored in yellow):

    UTCDateTime.jpg

  • ismaelivan Profile Picture
    578 on at

    I do not use any EDT.

    I will use sysutcdatetime and I send you my comments.

    Thanks!

  • ismaelivan Profile Picture
    578 on at

    Already use sysutcdatetime but still the time appears, compile and update the table, incremental cyl and restart, but the EDT does not appear in the grid field.4774.02.PNG4774.02.PNG3125.03.PNG

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Is the datetime field mandatory on your table? if so I feel it's trying to assign some value. Please try the following code in your data source initvalue method on your form.

       Table.DateTime = DateTimeUtil::MinValue();

       (or)

       Table.DateTime = utcDateTimeNull();

    Thanks,

    Chaitanya Golla

  • ismaelivan Profile Picture
    578 on at

    Hi Chaitanya, I filled the grid with a button, set a range.

    Does not enter the initvalue() method, then insert the line in the method init()

    But still showing the time in the column :(

    Thanks

    2476.05.PNG

    Sorry for my English, I'm from Mexico

    This show in SQL

    2476.05.PNG

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    No problem. initValue(on formdatsource) is the method that gets called when a record is created. Please try statement Table.DateTime = utcDateTimeNull() in initvalue (or) in the insert method of the table and also if the datetime is mandatory check by making it optional.

    Thanks,

    Chaitanya

  • ismaelivan Profile Picture
    578 on at

    Don't enter in method :(

    8863.09.PNG

    And I do not think it necessary to put it in the table insert method because the records already exist.

    6786.07.PNG

    Only from other process, i update the datetime.

    5148.08.PNG

    8863.09.PNG

    3542.10.PNG

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    initValue method will be called only when we create a record and not during updates.
    Please try the same statement i.e Table.DateTime = utcDateTimeNull() when you update the record(s) from other process.

    Thanks,
    Chaitanya Golla

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#3
Ali Zaidi Profile Picture

Ali Zaidi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans