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

Notifications

Announcements

No record found.

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

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 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

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,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans