Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

Error with custom report.

(1) ShareShare
ReportReport
Posted on by 95
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.
  • Verified answer
    Shrey Chauhan Profile Picture
    Shrey Chauhan 271 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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans