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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Use the "DT2Time" function in a table extension field

(0) ShareShare
ReportReport
Posted on by 92

I'm making an extension of the "Bank Account Ledger Entry" table, in which I need to create a new field called "Creation time", which would simply be the time that appears in the "SystemCreatedAt" field of type DateTime, already existing in the table. For this, I want to use the "DT2Time" function to extract the time part of that field and save it in the new field. The problem is, I don't know exactly where I should do this. Would it have to be done in a Trigger or something?

I know that the easiest thing is to do it directly in the page extension, but for this particular case, I need it to be a table field

  • Verified answer
    srttel Profile Picture
    Microsoft Employee on at

    In a table extension you have various triggers where you can update the field you want the date you need.

    OnBeforeInsert

    OnInsert

    OnAfterInstert

    OnBeforeModify

    OnModify

    OnAfterModify

    OnBeforeDelete

    OnDelete

    OnAfterDelete

    OnBeforeRename

    OnRename

    OnAfterRename

    docs.microsoft.com/.../devenv-triggers

    If you want to get your field when the record is modified it can look like:

    trigger OnModify()

       begin

           MyTime2 := DT2Time(SystemCreatedAt);

       end;

  • BchM Profile Picture
    92 on at

    I understand, thanks for responding. I have been testing each of those triggers, but the problem is that the field does not appear, unless there is a change, and I need the field to appear automatically, for each of the existing records. Is there any other way?

  • Suggested answer
    YUN ZHU Profile Picture
    103,132 Super User 2026 Season 2 on at

    Hi, I think you can make a patch to update the existing records, such as creating a new action, writing a repeat.

    Hope this will help.

    Thanks.

    ZHU

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 674 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 362 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 359 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans