web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Report Data Item Link

(0) ShareShare
ReportReport
Posted on by 147

Hi there,

I am editing the standard Sales Invoice as a custom report, so I am attempting to add in some other data items/links.

I need to join from the Sales Invoice Line table to the Job table, so that I can put the Description of the job on the invoice.

This is the code I have put in to do that:

                    dataitem(JobHeader; "Job")
                    {
                        DataItemLink = "No." = FIELD("Job No.");
                        DataItemLinkReference = Line;

                        column(Description; Description) { }

                    }

The field appears in the data set and in Report Builder, and I can put it on the report, but when I generate the report where that field should be it comes up blank.

Same goes for this data item where the field is part of a table extension:

                    dataitem(JobTask; "Job Task")
                    {
                        DataItemLink = "Job Task No." = FIELD("Job Task No."); //Left = the field in table in this dataitem, Right = the field in the table which we are joining to
                        DataItemLinkReference = Line;

                        column(xPONumber; JobTask.xPONumber) { }

                    }

Any advice on why these fields are available in the report but not showing any data would be very much appreciated

  • Suggested answer
    JAngle Profile Picture
    159 on at

    For two pieces of data more dataitems don’t seem worthwhile. Instead you could create two variables and populate them when data exists. I’d think the dataitem is failing as the link doesn’t always exist and you need to pass at least the primary key fields. For instance if you have a comment line. In the line dataitem within the OnAfterGetRecord trigger place a GET for the job table. Use the “job no.” From the line dataitem. You could place an if statement for the GET too. This way the variable stays blank when no data exists. Job task uses the job no. and the job task no. for a GET

    Resources: docs.microsoft.com/.../devenv-get-find-and-next-methods

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 796 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 481 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 377 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans