Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

Data Item link error

Posted on by 8
Hi,
I'm creating a PO rdlcreport, where I want to show different QR codes.
One QR for the PO number and one for the line.
 
When I add the DataItemLink I get the below error.
 

    "message": "The property value '\"Document No.\" = FIELD(\"No.\")' on property 'DataItemLink' is not valid.",
    "source": "AL",
    "startLineNumber": 44,
    "startColumn": 28,
    "endLineNumber": 44,
    "endColumn": 57
}]
 
Here is my code:
 
.
report 50102 "Purchase Order Barcode"
{
    ApplicationArea = All;
    RDLCLayout = 'PurchaseOrder.rdlc';
    UsageCategory = ReportsAndAnalysis;
 
    dataset
    {
        // DataItem for Purchase Header
        dataitem("Purchase Header"; "Purchase Header")
        {
            DataItemTableView = sorting("No.");
            RequestFilterFields = "No.";
 
            // Columns for Purchase Header
            column(No_; "Purchase Header"."No.")
            {
            }
            column(Vendor_Name; "Purchase Header"."Buy-from Vendor Name")
            {
            }
            column(Status; "Purchase Header"."Status")
            {
            }
            column(PurchaseheaderBarcode; "Purchase Header"."PurchaseheaderBarcode")
            {
            }
 
            trigger OnAfterGetRecord()
            var
                barcodeGenerator: Codeunit "IWX Library - Barcode Gen";
                barcodeDotSize: Integer;
                barcode: Record "IWX Barcode" temporary;
            begin
                barcodeDotSize := 4;
                barcodeGenerator.GenerateQRBarcode(barcode, "Purchase Header"."No.", barcodeDotSize);
                "PurchaseheaderBarcode" := barcode.Image;
            end;
        }
 
        // DataItem for Purchase Line nested under Purchase Header
        dataitem("Purchase Line"; "Purchase Line")
        {
            DataItemLink = "Document No." = FIELD("No.");
            DataItemTableView = sorting("Line No.");
 
            // Columns for Purchase Line
            column(Line_No; "Purchase Line"."Line No.")
            {
            }
            column(Item_No; "Purchase Line"."No.")
            {
            }
            column(Description; "Purchase Line"."Description")
            {
            }
            column(Quantity; "Purchase Line"."Quantity")
            {
            }
            column(Unit_Price; "Purchase Line"."Direct Unit Cost")
            {
            }
            column(Line_Amount; "Purchase Line"."Line Amount")
            {
            }
            column(PurchaseorderlineBarcode; "Purchase Line"."PurchaseorderlineBarcode")
            {
            }
 
            trigger OnAfterGetRecord()
            var
                barcodeGenerator: Codeunit "IWX Library - Barcode Gen";
                barcodeDotSize: Integer;
                barcode: Record "IWX Barcode" temporary;
            begin
                barcodeDotSize := 4;
                barcodeGenerator.GenerateQRBarcode(barcode, "Purchase Line"."No.", barcodeDotSize);
                "PurchaseorderlineBarcode" := barcode.Image;
            end;
        }
    }
}
 
 
Any help is appreciated, thanks in adavance.
Alex
  • AN-03061630-0 Profile Picture
    AN-03061630-0 8 on at
    Data Item link error
    Hi Zhu,
    thanks so much for your reply, this helps.
     
    Regards,
    Alex
  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 73,565 Super User 2024 Season 2 on at
    Data Item link error
    Please put Dataitem("Purchase Line"..." inside Dataitem("Purchase Header"...".
     
    You can refer to the standard report below.
    report 1322 "Standard Purchase - Order"
     
    Thanks
    ZHU

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans