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...
Suggested Answer

API: System Audit Date

(0) ShareShare
ReportReport
Posted on by

Hi,

I am developing a custom API to extract vendor and related data using BC 19.1. My API is working fine and I would like to add audit fields such as systemCreatedAt and SystemModifiedAt

I tried adding them using Rec as well xRec but getting compilation error 

                field(systemCreatedAt; Rec.SystemCreatedAt)
                {
                    Caption = 'SystemCreatedAt';
                }
                field(systemModifiedAt; Rec.SystemModifiedAt)
                {
                    Caption = 'SystemModifiedAt';
                }
compilation failed
src/api/manageVendorAPI.al(92,44):
error AL0132: 'Record Vendor' does not contain a definition for 'SystemCreatedAt' src/api/manageVendorAPI.al(96,45): error AL0132: 'Record Vendor' does not contain a definition for 'SystemModifiedAt'
Any idea what can be the best approach to add field such as SystemCreatedAt and SystemModifiedAt in my APIs (Page Type API)
Thanks
Famy
  • Community Member Profile Picture
    on at

    sorry BC version I am using is 16.5

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    Maybe you can try to use the lastmodifedat field and see if that works.

    I see that is the field MS use in their standard API's.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    I am using version 20.3 and this works fine for me:

    Unfortunately i do not have a version 16 to look at.

    page 50100 vendapi
    {
        APIGroup = 'vendor';
        APIPublisher = 'publisherName';
        APIVersion = 'v1.0';
        Caption = 'vendapi';
        DelayedInsert = true;
        EntityName = 'vendor';
        EntitySetName = 'Vendors';
        PageType = API;
        SourceTable = Vendor;
        
        layout
        {
            area(content)
            {
                repeater(General)
                {
                    field(systemCreatedAt; Rec.SystemCreatedAt)
                    {
                        Caption = 'SystemCreatedAt';
                    }
                    field(systemCreatedBy; Rec.SystemCreatedBy)
                    {
                        Caption = 'SystemCreatedBy';
                    }
                    field(systemId; Rec.SystemId)
                    {
                        Caption = 'SystemId';
                    }
                    field(systemModifiedAt; Rec.SystemModifiedAt)
                    {
                        Caption = 'SystemModifiedAt';
                    }
                    field(systemModifiedBy; Rec.SystemModifiedBy)
                    {
                        Caption = 'SystemModifiedBy';
                    }
                }
            }
        }
    }
    

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    Version 16 does not contain these fields. These fields are available starting from BC 17 (October 2020).

  • Suggested answer
    YUN ZHU Profile Picture
    104,090 Super User 2026 Season 2 on at

    Hi, Stefano is right.

    More details:

    Data audit system fields are added to every table in Dynamics 365 Business Central 2020 Release Wave 2 (BC17)

    https://yzhums.com/1897/

    Hope this helps as well.

    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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 664 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 446 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 282 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans