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

How to add a field from another table in a report extension.

(1) ShareShare
ReportReport
Posted on by 9
I want to create a new Pys. Inventory List with 2 other fields that are in the Item table.
/No./ is already there, but I also need /No. 2/ and /Item Category Code/
 
reportextension 50105 TellelisteEXT extends 722
{
    dataset
    {
        add(/Item Journal Line/)
        {
            column(ItemNo2_ItemJournalLine; item./No. 2/)
            { }
            column(ItemCatCode_ItemJournalLine; item./Item Category Code/)
            { }
        }
    }
 
    requestpage
    {
        // Add changes to the requestpage here
    }
 
    rendering
    {
        layout(LayoutName)
        {
            Type = RDLC;
            LayoutFile = 'Telleliste.rdl';
        }
    }
}
I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,993 Super User 2025 Season 2 on at
    How to add a field from another table in a report extension.
    Did you get item record anywhere?
    You may have to get it like
            modify("Item Journal Line")
            {
                trigger OnBeforeAfterGetRecord()
                begin
                    item.Get("Item No.");
                end;
            }
  • Community member Profile Picture
    9 on at
    How to add a field from another table in a report extension.
    I only get this error with or without your code:
    error AL0161: 'Item' is inaccessible due to its protection level
     
    So if I press CTRL+F5 it starts compiling and gives the error.
     
    With your code before or after "add" I get that same error twice:
    \Phys.Inv.List.Ext.al(14,45): error AL0161: 'Item' is inaccessible due to its protection level
    \Phys.Inv.List.Ext.al(16,49): error AL0161: 'Item' is inaccessible due to its protection level
  • Verified answer
    YUN ZHU Profile Picture
    95,307 Super User 2025 Season 2 on at
    How to add a field from another table in a report extension.
    Hi, try the following.
    reportextension 50118 MyExtension extends "Phys. Inventory List"
    {
        dataset
        {
            addfirst("Item Journal Line")
            {
                dataitem(Item; Item)
                {
                    DataItemLink = "No." = field("Item No.");
                    DataItemLinkReference = "Item Journal Line";
    
                    column(ItemNo; Item."No.")
                    { }
                }
            }
        }
    }
     
    Hope this helps.
    Thanks.
    ZHU
  • Community member Profile Picture
    9 on at
    How to add a field from another table in a report extension.
    Thanks! That put me on the right track and I was able to get the correct fields :)

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans