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

Fill table via Visual Studio

(0) ShareShare
ReportReport
Posted on by 5

Hello dear forum,
I've been working on a project for the university for a long time. I have to fill a table via Visual Studio with the information of another already given table. Unfortunately, I don't know how to do that. I would be happy if you could help.

Kind regards
Danny

I have the same question (0)
  • Suggested answer
    pankaj.k Profile Picture
    994 on at
    RE: Fill table via Visual Studio

    Hi Densonx21

    Please check the below link that will help you to insert data in new table.

    https://learn.microsoft.com/en-US/dynamics365/business-central/dev-itpro/administration/set-up-standard-company-configuration-packages

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-extension-install-code

    Have a great day!

    Don't forget to help the community by verifying the answer if your question has been answered. It will let others know that the topic has verified answer.

    Thanks,

    Contact Info: kuwalpankaj97@gmail.com  

  • Suggested answer
    DAnny3211 Profile Picture
    11,397 on at
    RE: Fill table via Visual Studio
    hi
    try this 
    local procedure InsertSyncTableLoop()
        var
            SourceTable: Record SourceTable;
            SyncTable: Record "Sync Table";
        begin
            if SourceTable.FindFirst() then
                repeat
                    SyncTable.Init();
                    SyncTable."Primary Key" := SourceTable."Primary Key";
                    SyncTable.D1 := SourceTable.S1;
                    SyncTable.D2 := SourceTable.S2;
                    SyncTable.D3 := SourceTable.S3;
                    SyncTable.Insert();
                until SourceTable.next = 0;
        end;
    check my answer if it helped you, thanks
    DAniele
  • Suggested answer
    YUN ZHU Profile Picture
    95,307 Super User 2025 Season 2 on at
    RE: Fill table via Visual Studio

    Hi, If you mean to insert values, you can use Record.Insert() Method.

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/record/record-insert--method

    pastedimage1670804676361v1.png

    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

Responsible AI policies

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

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans