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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Get Debit amount, Credit amount and balance amount for customer statement

(1) ShareShare
ReportReport
Posted on by 756
Hi everyone,
  Any idea how can i get debit amount, credit amount , balance amount from Custtrans/custtransopen tables using X++
 
Thanks,
H
I have the same question (0)
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,811 Super User 2026 Season 1 on at
    Hi @Hisham,
     
    there a field AmounCur 
     
    if AmountCur < 0 then Credit else Debit
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Hisham Alsayed Profile Picture
    756 on at
    Hi Mohamed,
     
       Thanks for your reply i understand now but do you have x++ for that or try it in real case and what about the balance amount how can i get it?
     
    Thanks,
    Hisham
  • Suggested answer
    Raj Borad Profile Picture
    1,578 on at
    Hi Hisham,
    Here is your answer.
    Pls, mark the reply as a verified answer.
     
    AmountMST credit = 0,debit = 0,balance = 0;
    CustTrans custTrans;
    while Select custTrans where custTrans.AccountNum == "AsPerYourRequirement" // customer account
    {
        if(custTrans.SettleAmountMST > 0)
        {
            credit += custTrans.AmountMST;
        }
        else
        {
            debit += custTrans.AmountMST;
        }
    }
    // Total credit and debit of Customer
    balance = credit - debit;
     
    Thank you,
    Raj D Borad
  • Hisham Alsayed Profile Picture
    756 on at
    Hi Raj,
     
        Many thanks on your reply, let me try it and will update you for balance is it credit - debit or debit - credit because customer natural account is debit i need to ensure from this part 
      Also, why do you settlementamountmst and do not use AmountCur
    did you use or try this code before
     
    Thanks
    H

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

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 263 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 257 Super User 2026 Season 2

#3
Subra Profile Picture

Subra 235 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans