Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Document Date not available in standard Customer Statement Report?

(4) ShareShare
ReportReport
Posted on by 130
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/)
        {
        }
    }
}
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 75,561 Super User 2024 Season 2 on at
    Document Date not available in standard Customer Statement Report?
    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
     
  • GP-05061852-0 Profile Picture
    GP-05061852-0 21 on at
    Document Date not available in standard Customer Statement Report?
    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
    YUN ZHU 75,561 Super User 2024 Season 2 on at
    Document Date not available in standard Customer Statement Report?
    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
    GP-05061852-0 21 on at
    Document Date not available in standard Customer Statement Report?
    My second attempt, to no avail
     
    ​​​​​​​

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans