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...
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;
}
 
 
I have the same question (0)
  • YUN ZHU Profile Picture
    95,763 Super User 2025 Season 2 on at
    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
     
  • Khushbu Rajvi. Profile Picture
    20,960 Super User 2025 Season 2 on at
    Is this resolved by the previous solution?

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 2,116

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans