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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Init the records from setup table.

(1) ShareShare
ReportReport
Posted on by 67

Hi

I want to Insert some fields in my table from my setup table, as default fields for every new record.

pastedimage1661938476115v1.png

Currently, it is not getting the records from my Setup Table, as soon as I add the source type and move to the next field it gets records on my page.

pastedimage1661938607142v2.png

I have tried both OnInsert() in my table and OnInsertRecord() in my form, but it only works when the record is inserted into the table... when I leave the control that shows the primary key in the form.

    // This is the code on my Card Page of above screenshot.
    trigger OnInsertRecord(BelowxRec: Boolean): Boolean
    var
        uerRoyaltyAllocationParm: Record uerRoyaltyAllocationParameters;
    begin
        uerRoyaltyAllocationParm.Get();
        Rec.uerCommLedgerDimensionAccount := uerRoyaltyAllocationParm.uerCommLedgerDimensionAccount;
        Rec.uerAllocLedgerDimensionAccount := uerRoyaltyAllocationParm.uerAllocLedgerDimensionAccount;
        Rec.uerBatchLedgerDimensionAccount := uerRoyaltyAllocationParm.uerBatchLedgerDimensionAccount;
    end;

Is there any way or any other method to initialize the values before I insert the primary key.. as we do with the Init method of D365F&O?

Thanks.

I have the same question (0)
  • Suggested answer
    THE Italian Profile Picture
    Microsoft Employee on at

    You might look at the code of any setup table from the base application. 

    See (+) Initialize Setup Tables - Microsoft Dynamics NAV Community

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    You can take an idea how the default values getting insert like Posting Date, Source Code etc. on any journal, for ex. take Payment Journal.

    Thanks.

  • Suggested answer
    Amit Baru Profile Picture
    3,043 on at

    Hi,

    Pls refer the General Ledger Setup Table and Page for reference and do the same steps in you custom table along with same logic.

    Regards

    Amit Sharma

    www.erpconsultors.com

    https://linkedin.com/in/amit-sharma-94542440

    Press Yes if info is useful. 

  • Suggested answer
    YUN ZHU Profile Picture
    102,516 Super User 2026 Season 1 on at

    Hi, hope the followin helps.

    Matters needing attention when creating a new setup page:

    https://yzhums.com/8924/

    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 June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 677 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 521 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 306 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans