Skip to main content

Notifications

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

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 74,036 Super User 2024 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

  • Suggested answer
    DAnny3211 Profile Picture
    DAnny3211 9,272 Super User 2024 Season 1 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
    pankaj.k Profile Picture
    pankaj.k 962 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  

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans