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