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

Report Extension Add Custom fields from other table to report dataset (repost)

(1) ShareShare
ReportReport
Posted on by 10
Sorry for the repost!
My previous question did not include the description for some reason so thought a repost might work abit better then just editing the post.

So basically i am attempting to create a report extension for Pick Instructions report.
I am attempting to add the LotNo field to the Pick Instructions Report via ReportExtension. I am able to get columns added from the pre existing tables. I am using DataItemLink and dataitem to display the lot No. with the following code. 
 
reportextension 50102 PickInstructionExt extends /Pick Instruction/
{
    dataset
    {
        add(/Sales Line/)
        {
            column(itemNo1; /No./)
            {
                IncludeCaption = true;
            }
        }
        addlast(/Sales Line/)
        {
            dataitem(/item/; /Item/)
            {
                DataItemLink = /No./ = FIELD(/No./);
                column(itemNo2; /No./)
                {
                    IncludeCaption = true;
                }
                dataitem(/Reservation Entry/; /Reservation Entry/)
                {
                    DataItemLink = /Item No./ = FIELD(/No./);
                    column(LotNumber; /Lot No./)
                    {
                        IncludeCaption = true;
                    }
                }
            }
        }

So the column I created being itemNo1 displays the No. however any column I try add in the addlast(/Sales Line/) always displays as blank. I added column itemNo2 to test to see if the issue is the way i linked from sales line to Lot No. However even the link from sales line to item and then grabbing the No. from item shows up blank. 

I am updating the report using microsft report builder and it is showing the columns I added in datasets. I have tried dragging directly from that to the report where it uses =First(Fields!LotNumber.Value)
I have also tried =Fields!LotNumber.Value with no success. Currently im just trying to see if I can pull anything at all from a table that isnt already in the pick instructions report. 
I dont even know where to debug any further haha
I have the same question (0)
  • Verified answer
    YUN ZHU Profile Picture
    93,024 Super User 2025 Season 2 on at
    Report Extension Add Custom fields from other table to report dataset (repost)
    Hi, you can use the following method to check if there is a value.
    Dynamics 365 Business Central: Save report dataset to Excel from the request page (Report Inspector)
     
    Hope this can give you some hints.
    Thanks.
    ZHU
  • CS-08050546-0 Profile Picture
    10 on at
    Report Extension Add Custom fields from other table to report dataset (repost)
    Hi, Thank You Yun Zhu, seen some of your other work and that's exactly how I ended up debugging it and is a great way of doing it alongside working with bcentral.dev for the ERD. Thanks for the assistance!

    The code wasn't 100% correct so thought I'd share the full code for anyone seeing this in the future.  
     
            addlast("Sales Line")
            {
                dataitem("Reservation Entry"; "Reservation Entry")
                {
                    DataItemLink = "Item No." = FIELD("No."), "Source ID" = FIELD("Document No.");
                    column(LotNumber; "Lot No.")
                    {
                        IncludeCaption = true;
                    }
                    column(baseQuantity; "Quantity (Base)")
                    {
                        IncludeCaption = true;
                    }
                    column(sourceId; "Source ID")
                    {
                        IncludeCaption = true;
                    }
                }
            }


     

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,808

#2
Sumit Singh Profile Picture

Sumit Singh 2,554

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,140

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans