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;
}
 
 
  • Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 8,782 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
    YUN ZHU 77,879 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans