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 :
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
    on at
    RE: Init the records from setup table.

    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,692 Moderator on at
    RE: Init the records from setup table.

    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,037 on at
    RE: Init the records from setup table.

    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
    93,024 Super User 2025 Season 2 on at
    RE: Init the records from setup table.

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,808

#2
Sumit Singh Profile Picture

Sumit Singh 2,554

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,140

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans