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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Document Date not available in standard Customer Statement Report?

(4) ShareShare
ReportReport
Posted on by 184
When navigating the XML parts of the Customer Statement report, the Document Date field is not visible anywhere, only the Posting & Due Dates—strangely/tantalizingly, there is a DocDateCaption field as standard, though I cannot imagine any scenario where this could be useful without the actual Document Date to be used in the loop…
 
It seems that the Document Date is only available in table 21 /Cust. Ledger Entry/, not in table 379 /Detailed Cust. Ledg. Entry/. I have attempted the below report extension by taking inspiration from the standard PostDate_DtldCustLedgEntries & DueDate_DtldCustLedgEntries fields, but the Document Date field is still not showing when running the newly imported report. 
 
Where am I going wrong?
 
 
Also, does anyone know what the row containing Currency2Code_CustLedgEntryHdr & StartBalance does? Not sure if removing it would affect the report.
 

EDIT
I have tried re-editing this post multiple times, but, inexplicably, after publishing the question, all instances of // (quotation marks) turn into // instead. Here is a screenshot instead:
 
 
 
reportextension 50301 CustomerStatementReportExt extends /Standard Statement/
{
    dataset
    {
        /*
        add(CustLedgEntry2)
        {
            column(DocDate_CustLedgEntry2; Format(/Document Date/))
            {
            }
        }
        */
        addbefore(DtldCustLedgEntries)
        {
            dataitem(MyCustom; /Cust. Ledger Entry/)
            {
                DataItemLink = /Customer No./ = field(/No./);
                DataItemLinkReference = Customer;
                DataItemTableView = sorting(/Customer No./, /Document Date/, /Currency Code/);
                column(My_DocDate_CustLedgEntry; Format(/Document Date/)) { }
 
                /*trigger OnAfterGetRecord()
                begin
                    My_DocDate_CustLedgEntry := CustLedgEntry2./Document Date/;
                    CustLedgEntry2.SetCurrentKey(/Customer No./, /Document Date/, /Currency Code/);
                end;
                */
            }
        }
    }
    rendering
    {
        layout(/MyCustomerStatement.docx/)
        {
            Type = Word;
            LayoutFile = './Document/MyCustomerStatement.docx';
            Caption = 'My Customer Statement (Word)';
            Summary = 'Custom Customer Statement report with fixed doc date fields.';
        }
        layout(/MyCustomerStatementEmail.docx/)
        {
            Type = Word;
            LayoutFile = './Document/MyCustomerStatementEmail.docx';
            Caption = 'My Customer Statement Email (Word)';
            Summary = 'Custom Customer Statement report with fixed doc date fields.';
        }
    }
    var
        My_DocDate_CustLedgEntry: Date;
}
 
tableextension 50301 CustLedgEntryExt extends /Cust. Ledger Entry/
{
    keys
    {
        key(MyKey1; /Document Date/)
        {
        }
    }
}
  • GP-05061852-0 Profile Picture
    25 on at
    My second attempt, to no avail
     
    ​​​​​​​
  • Suggested answer
    YUN ZHU Profile Picture
    103,292 Super User 2026 Season 2 on at
    Hi, I took a quick look and it seemed like the following would be enough.
     
    So try the following:
     
    Hope this helps.
    Thanks.
    ZHU
  • GP-05061852-0 Profile Picture
    25 on at
    Thanks for having a look at this YUN ZHU, but the field in question is "Document Date", not the Document No.
  • Suggested answer
    YUN ZHU Profile Picture
    103,292 Super User 2026 Season 2 on at
    Sorry, my bad.
    A simple way is to add this field (Posting Date) first, so that there will be much less processing in the report.
    reportextension 50119 MyExtension extends "Standard Statement"
    {
        dataset
        {
            add(DtldCustLedgEntries)
            {
                column(CLE_Document_Date; "CLE Document Date")
                { }
            }
        }
    }
    
    tableextension 50118 MyExtension extends "Detailed Cust. Ledg. Entry"
    {
        fields
        {
            field(50100; "CLE Document Date"; Date)
            {
                Caption = 'Cust. Ledger Entry Document Date';
                FieldClass = FlowField;
                CalcFormula = lookup("Cust. Ledger Entry"."Document Date" where("Entry No." = field("Cust. Ledger Entry No.")));
            }
        }
    }
     
    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

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

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 796 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 481 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 377 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans