Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

Report Extension Add Custom fields from other table to report dataset

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 14,577 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

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans