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

Error with custom report.

(1) ShareShare
ReportReport
Posted on by 99
Hi,
How can I obtain the related records between the 'Item Journal Line' table and the 'Reservation Entry' table in a custom report?
On the 'Production Journal' page I added a button called 'Generate Labels' and I want to show in the report the records from the 'Reservation Entry' table that are related to the 'Output' type records from the 'Production Journal' page.
I already tried with 'SetSelectionFilter' and 'SetTableView', however it shows an error with DataItem.
 
//////
 
 
Thanks in advance.
  • Suggested answer
    Shrey Chauhan Profile Picture
    297 on at
    Hello,

    Here's the source code for your queries :

     dataitem("Prod. Order Line"; "Prod. Order Line")
                {
                    PrintOnlyIfDetail = true;
                    DataItemLink = "Item No." = field("Item No.");
                    DataItemLinkReference = "Production Budget Qty";
                    DataItemTableView = sorting("Prod. Order No.", "Line No.") where(Status = filter(Status::Finished | Status::Released));
                    column(Line_No_; "Line No.")
                    {
                    }
                    column(Prod__Order_No_; "Prod. Order No.")
                    {
                    }
                    dataitem("Reservation Entry"; "Reservation Entry")
                    {
                        DataItemLink = "Item No." = field("Item No."), "Location Code" = field("Location Code"), "Source ID" = field("Prod. Order No."), "Source Prod. Order Line" = field("Line No."), "Variant Code" = field("Variant Code");
                        DataItemLinkReference = "Prod. Order Line";
                        DataItemTableView = sorting("Item No.", "Variant Code", "Location Code") where("Source Type" = filter(Database::"Prod. Order Line"), "Source Subtype" = filter(3));
                        column(Lot_No_Reservation; "Lot No.")
                        {
                        }
                        column(Quantity; Quantity)
                        {
                        }
                    }
     
    Hope this solution's help.

    Thank You,
    Shrey Chauhan

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

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 676 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 483 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 310 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans