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...
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.
I have the same question (0)
  • Suggested answer
    Shrey Chauhan Profile Picture
    284 on at
    Error with custom report.
    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

Responsible AI policies

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

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,267

#2
Sumit Singh Profile Picture

Sumit Singh 2,098

#3
YUN ZHU Profile Picture

YUN ZHU 1,766 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans