Skip to main content

Notifications

Community site session details

Community site session details

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

reportextension 70xxx "xxx_Ext" extends "Warehouse Register - Quantity"

(1) ShareShare
ReportReport
Posted on by 39

I attempted to code this report extension but encountered an error:

"A DataItem with name 'EntryType_WarehouseEntry' could not be found in the target Warehouse Register - Quantity."

However, the data item is indeed present in the report.

I am using "runtime": "10.0".

 
reportextension 70XXX "XXX_Ext" extends "Warehouse Register - Quantity"
{
    RDLCLayout = 'Reports/Layout/XXXWarehouseRegisterQuantity.rdlc';
 
    dataset
    {
        modify("Warehouse Entry")
        {
            addafter("EntryType_WarehouseEntry")
        {
                column(AccountValue_WarehouseEntry; CalcAccountValue)
                {
                    Caption = 'Valor Contábil';
                    ToolTip = 'Valor contábil calculado com base nos movimentos do item.';
                    DataType = Decimal;
                    SourceExpr = CalcAccountValue;
                }
            }
        }
    }
 
    var
        CalcAccountValue: Decimal;
 
    trigger OnAfterGetRecord()
    var
        ItemLedgerEntry: Record "Item Ledger Entry";
        WarehouseEntry: Record "Warehouse Entry";
    begin
        CalcAccountValue := 0;
 
        // Filtra os registros da tabela 7312 - Mov. Armazém
        WarehouseEntry.SetRange("Item No.", "Item No.");
        WarehouseEntry.SetRange("Posting Date", "Posting Date");
        WarehouseEntry.SetRange(Quantity, Quantity);
        WarehouseEntry.SetRange("Lot No.", "Lot No.");
 
        if WarehouseEntry.FindSet() then
        begin
            repeat
                // Filtra os registros da tabela 32 - Mov. Item com base nos filtros da tabela 7312
                ItemLedgerEntry.Reset();
                ItemLedgerEntry.SetRange("Item No.", WarehouseEntry."Item No.");
                ItemLedgerEntry.SetRange("Posting Date", WarehouseEntry."Posting Date");
                ItemLedgerEntry.SetRange(Quantity, WarehouseEntry.Quantity);
                ItemLedgerEntry.SetRange("Lot No.", WarehouseEntry."Lot No.");
 
                if ItemLedgerEntry.FindFirst() then
                    CalcAccountValue += ItemLedgerEntry."Actual Cost Amount (ACY)";
            until WarehouseEntry.Next() = 0;
        end;
    end;
}
 
 
  • Khushbu Rajvi. Profile Picture
    14,584 Super User 2025 Season 1 on at
    reportextension 70xxx "xxx_Ext" extends "Warehouse Register - Quantity"
    Is this resolved by the previous solution?
  • YUN ZHU Profile Picture
    81,711 Super User 2025 Season 1 on at
    reportextension 70xxx "xxx_Ext" extends "Warehouse Register - Quantity"
    Hi, There is something wrong with your code. Use the keyword "Add" instead.
     
    PS: Dynamics 365 Business Central 2021 release wave 1 (BC18): Report extensibility (ReportExtension Object)
     
    Hope this helps.
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,221 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,982 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans