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 :
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)
  • ismaelivan Profile Picture
    578 on at
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    I'm sorry but I could not solve my problem

  • Giuseppe Scaltrito Profile Picture
    50 on at
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    Hi Ismaelivan,

    AX does not support the concept of null values. A field in Microsoft Dynamics AX always has a type and a value. So if you use a datetime field you will obtain a null value as: refer to: msdn.microsoft.com/.../aa846236.aspx.

    As suggestion, you can use a dataMethod in the grid to convert datetime to string e show the string null value. I think that's what you want to see.

    datetime2string:

    msdn.microsoft.com/.../cc637978.aspx

    Please mark verified if this answers your question.

    Regards.

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    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

  • ismaelivan Profile Picture
    578 on at
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    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
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    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
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    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
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    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
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    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

  • ismaelivan Profile Picture
    578 on at
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    I do not use any EDT.

    I will use sysutcdatetime and I send you my comments.

    Thanks!

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at
    RE: How hide UtcDataTimeEdit with DateTime Min 1900-01-01 12:00:00

    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

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

#1
Syed Haris Shah Profile Picture

Syed Haris Shah 9

#2
Mea_ Profile Picture

Mea_ 4

#3
Rahul Shah Profile Picture

Rahul Shah 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans