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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Customer Receivable report

(0) ShareShare
ReportReport
Posted on by 10

Hello Experts,

I am creating a report as below:

Customer No             Remaining Balance      Customer Balance

Opening Bal                                                           1000

Cust A                        100                                       1100

Cust B                        50                                        1150

Cust C                       -200                                      950

   =============================================

                                                              Total          2400

I am unable to add Customer Balance.

I Created one variable: CustBalance

CustBalance:=openening bal + Remaining balance

It doesn't give the correct result.

Kindly help.

Eva

I have the same question (0)
  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    A little hard to help you with this unless you share the code for your report so we can see what approach you have used and at what stage in your code you do the different calculation.

    Maybe you can share the code here?

  • Eva2020 Profile Picture
    10 on at

    I just added one data item that is Customer ledger entry and below is the code:

    OnAfterGetRecord Trigger

    OpenBal:=0;

    //CustBal:=0;

    CustLedgerEntry.RESET;

    CustLedgerEntry.SETFILTER("Posting Date",'%1',"Cust. Ledger Entry"."Posting Date"-1);

    IF CustLedgerEntry.FINDSET THEN

     REPEAT

       CustLedgerEntry.CALCFIELDS("Remaining Amount");

       OpenBal:=OpenBal+CustLedgerEntry."Remaining Amount";  

       UNTIL

       CustLedgerEntry.NEXT=0;

    CustBal:=OpenBal+"Cust. Ledger Entry"."Remaining Amount";

    CustBal2:=CustBal;

  • Eva2020 Profile Picture
    10 on at

    Hello Inge,

    I have pasted the code below.  Any help will be appriciated

    Eva

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    Is the CustLedgerEntry variable you use in the trigger the same as the one you are using as your dataitem.

    It would be easier if you shared the whole report object and not only the trigger.  Then i can try to run it myself here.

  • Suggested answer
    Amit Baru Profile Picture
    3,043 on at

    Hi,

    As per my understanding, Customer Balance in your report is Running Balance. So we can not do the total of Customer Balance or Running Balance as per the above reports and its logic.

    Regards

    Amit Sharma

    www.erpconsultors.com

    linkedin.com/in/amit-sharma-94542440/

    Please press Yes if info is useful.

  • Eva2020 Profile Picture
    10 on at

    Hello Inge

    where i can send you the object. I am not getting any option to attach the object here.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    You can either go to rich formatting and insert code or you can use the e-mail i sent you in a message.

    pastedimage1661523356302v1.png

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,466 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,829 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,505

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans