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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Cant get field references on reportExtension in vsCode

(0) ShareShare
ReportReport
Posted on by 25

I am extending a report from Warehouse Insight so I can use there barcode generator.

I can product a barcode using this method but I am having trouble getting additional fields from the Item table and linking them to the barcode text.

barcodeText := itemGTIN   variable   itemDesciption   variable   Format(itemWeight, 9)   variable   "Country/Region Code"   variable   "Lot No.";

Fields from the diItemLedgerEntry work fine. But GTIN, Description and Gross Weight from Item are not showing up.
This is my report extension.
I understand the variables added at end are probably not correct. I was just testing many different things
reportextension 50202 "AM Item Barcode Label" extends "WHI Item Barcode Label"
{
    RDLCLayout = 'AM Item Barcode Label.rdlc';

    dataset
    {

        addfirst(diItemLedgerEntry)
        {
            dataitem(Item; Item)
            {
                DataItemLink = "No." = field("Item No.");
                DataItemTableView = sorting("No.");
                column(GTIN; GTIN) { }
                column(Gross_Weight; "Gross Weight") { }
                column(Description; Description) { }

                trigger OnPreDataItem()
                begin
                    itemGTIN := GTIN;
                    itemWeight := "Gross Weight";
                    itemDesciption := GTIN;
                end;
            }
        }

        add(diItemLedgerEntry)
        {
            column(barcodeImage; Barcode.Image)
            {
            }
            column(barcodeText; barcodeText)
            {
            }

        }

        modify(diItemLedgerEntry)
        {

            trigger OnAfterAfterGetRecord()
            var
                BarcodeGeneration: Codeunit "IWX Library - Barcode Gen";
                variable: Text;
            begin
                variable[1] := 10;
                barcodeText := itemGTIN   variable   itemDesciption   variable   Format(itemWeight, 9)   variable   "Country/Region Code"   variable   "Lot No.";
                //Item.GTIN   variable   "Description"   variable   Format(Item."Gross Weight", 9)
                BarcodeGeneration.GenerateQRBarcode(Barcode, barcodeText, 220);
            end;
        }


    }

    var
        Barcode: Record "IWX Barcode" temporary;
        barcodeText: Text;
        itemGTIN: Text;
        itemWeight: Decimal;
        itemDesciption: Text;

}
Here is the report im extending from
report 23044900 "WHI Item Barcode Label"
{
  RDLCLayout = 'source/reports/WHI Item Barcode Label.rdlc';
  Caption = 'Warehouse Insight Item Barcode Label';

  dataset
  {
    dataitem(diItem; Item)
    {
      column(diItem_No_;'Code[20]')
      {
      }
    }
    dataitem(diItemLedgerEntry; "Item Ledger Entry")
    {
    }
    dataitem(diLabels; Integer)
    {
      dataitem(diNumCopies; Integer)
      {
        column(trecItems_No;'Code[20]')
        {
        }
        column(trecItems_Description;'Text')
        {
        }
        column(trecItems_Routing;'Code[50]')
        {
        }
        column(fldBarcode;'Blob')
        {
        }
        column(fldLotSerialBarcode;'Blob')
        {
        }
        column(diNumCopies_Number;'Integer')
        {
        }
        column(fldQuantity;'Decimal')
        {
        }
        column(fldUnitOfMeasure;'Code[10]')
        {
        }
        column(fldIncludeQty;'Boolean')
        {
        }
        column(fldExpiryDate;'Text')
        {
        }
      }
    }
  }
  requestpage
  {
    layout
    {
      area(content)
      {
        group(Options)
        {
          Caption = 'Options';

          field(fldNumCopies; iNumCopies)
          {
            Caption = 'Number of Copies';
          }
          field(fldIncludeQty; bIncludeQty)
          {
            Caption = 'Include Quantity';
          }
        }
      }
    }
  }
  var trecItems: Record Item temporary;
  recWHISetup: Record "WHI Setup";
  trecBarcode: Record "Company Information" temporary;
  trecLotSerialBarcode: Record "Company Information" temporary;
  cuWHICommon: codeunit "WHI Common Functions";
  cuSessionHelper: codeunit "WHI Session Helper";
  iNumCopies: Integer;
  iCount: Integer;
  bIncludeQty: Boolean;
  tcOnlyOneFilterErr: Label;
  dQuantity: Decimal;
  codUOM: Code[10];
  codTrackingNumber: Code[50];
  dtExpiryDate: Date;
  sExpiryDate: Text;
}

I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    Microsoft Employee on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    I will open this up to the community in case they have something to add.

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 July Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 572 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 331 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 330 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans