Skip to main content
Dynamics 365 Community / Forums / Finance forum / Get Debit amount, Cred...
Finance forum
Suggested answer

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

editSubscribe (2) ShareShare
ReportReport
Posted on by 723
Hi everyone,
  Any idea how can i get debit amount, credit amount , balance amount from Custtrans/custtransopen tables using X++
 
Thanks,
H
Attachments
  • Hisham Alsayed Profile Picture
    Hisham Alsayed 723 on at
    Get Debit amount, Credit amount and balance amount for customer statement
    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
  • Suggested answer
    rajborad Profile Picture
    rajborad 97 on at
    Get Debit amount, Credit amount and balance amount for customer statement
    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
    Hisham Alsayed 723 on at
    Get Debit amount, Credit amount and balance amount for customer statement
    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
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 3,684 User Group Leader on at
    Get Debit amount, Credit amount and balance amount for customer statement
    Hi @Hisham,
     
    there a field AmounCur 
     
    if AmountCur < 0 then Credit else Debit
     
    Best regards,
    Mohamed Amine MAHMOUDI

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,176 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,727 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans