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...
Answered

looping in dataitem

(0) ShareShare
ReportReport
Posted on by 450

Ok so i've created a report with a dataitem(Item; Item).

Now for every record in the Item table i want to add a few variables into another table now i was wondering if within the dataitem i am already holding a record or if i still need to loop over them?

as an example of what i mean:

dataitem(Item; Item)
{
    RequestFilterFields = Description, "Vendor No.", "Item Category Code";
    trigger OnAfterGetRecord()
    var
        OtherTable: Record "OtherTable";
    begin
        OtherTable.Init();
        OtherTable."Item No." := Item."No.";
        OtherTable.Insert(true);
     end;
}

or do i need to use:

dataitem(Item; Item)
{
    repeat
            RequestFilterFields = Description, "Vendor No.", "Item Category Code";
            trigger OnAfterGetRecord()
            var
                OtherTable: Record "Other Table";
            begin
                OtherTable.Init();
                OtherTable."Item No." := Item."No.";
                OtherTable.Insert(true);
             end;
     until Item.Next = 0;
}
thanks in advance
I have the same question (0)
  • Verified answer
    keoma Profile Picture
    32,729 on at

    first one

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,850 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,045 Super User 2026 Season 1

#3
Dhiren Nagar Profile Picture

Dhiren Nagar 959 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans