Skip to main content

Notifications

Business Central forum
Suggested answer

Report Extension Add Custom fields from other table to report dataset

editSubscribe (1) ShareShare
ReportReport
Posted on by 10
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
  • CS-08050546-0 Profile Picture
    CS-08050546-0 10 on at
    Report Extension Add Custom fields from other table to report dataset
    For some reason it removed the description for my post. I have already attempted what has been mentioned by the reply's in the group. I've added back in the description
  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 10,155 User Group Leader on at
    Report Extension Add Custom fields from other table to report dataset
    Hi,
     
    To add a field in report using report extension, you need to add a dataitem of the table and then add field from the data item.
     
    Regards,
    Saurav Dhyani
  • Suggested answer
    Judy Profile Picture
    Judy Microsoft Employee on at
    Report Extension Add Custom fields from other table to report dataset
    Hi, please refer to the old thread for the same topic:
    Best Regards,
    Judy

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,375 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans