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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Balance calculation on Customer Account Statement Report in D365

(0) ShareShare
ReportReport
Posted on by 195

Hi All,

I was working on a customization that required the sorting of customer transactions on report by invoice number then by date. After doing that, I found out that the balance was not calculating as it should be, like for every next balance, it would contain previous balance + next (credit or debit).

Any ideas how to fix this?

pastedimage1570316545700v1.png

Regards,

Ali

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,576 Super User 2025 Season 2 on at
    RE: Balance calculation on Customer Account Statement Report in D365

    Hi Ali,

    We are not able to know what coding you have used to build your report. Can you share some information? Then we might be able to help you.

  • Ali Sajjad Profile Picture
    195 on at
    RE: Balance calculation on Customer Account Statement Report in D365

    Hi Andre,

    pastedimage1570446014313v1.png

    I've added 2 new columns in Customer account statement report, Payment and Credit note and populating the value respectively. For the invoice column it now contains multiple values of same invoices as well. What I want to do is to sort the data with respect to invoice column and then by date. In this snapshot, balances are calculating incorrectly. May be because it is still ordering them on date basis. 

    I've made changes in DP class of customer account statement report, attached here is the snapshot.

    pastedimage1570446353146v2.png

    Regards,

    Ali

  • Verified answer
    André Arnaud de Calavon Profile Picture
    299,576 Super User 2025 Season 2 on at
    RE: Balance calculation on Customer Account Statement Report in D365

    Hi Ali,

    Where it builds the temporary data, you have to change the fetch order of the source table(s) to sort by invoice; then date. I do think it calculates the balance columns in that part.

  • Ali Sajjad Profile Picture
    195 on at
    RE: Balance calculation on Customer Account Statement Report in D365

    Hi Andre,

    Yes this is what I did but with a twist. I copied data from actual tmp table to another tmp table using order by Invoice then Date. Then I flushed the original tmp table and re-inserted the records in that table.

    Regards,

    Ali Sajjad

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 835 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans