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 :
Dynamics 365 Community / Forums / Finance forum / Display running balanc...
Finance forum

Display running balance in standers form

(0) ShareShare
ReportReport
Posted on by

Hi Expert,

i want to show running balance in CustTrans form any way to display running balance in the form level.

Thanks

shubham

I have the same question (0)
  • Pedro Tornich Profile Picture
    on at
    RE: Display running balance in standers form

    Hi Shubham,

    What do you mean by "running balance"?

    Is this the customer current balance?

    Can you tell us where this information comes from? (add screen shots if possible)

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at
    RE: Display running balance in standers form

    Hi,

    If you open the customer transactions form in D365FO then you should be able to see a 'balance' column.

    Isn't this what you are looking for?

    Best regards,

    Ludwig

  • shubhi gupta Profile Picture
    on at
    RE: Display running balance in standers form

    running-balance.png

    Hi Pedro and Ludwing i need the amount which is mark in red color here calculation happen in every line (running balance for last line) + (debit or credit)

    can you suggest me how to display this

  • Suggested answer
    Pedro Tornich Profile Picture
    on at
    RE: Display running balance in standers form

    Hi Shubham Gupta,

    Now I understand what you mean by running balance.

    Here is a sample code:

    [SysClientCacheDataMethodAttribute(true)]
    public display Amount runningBalance()
    {
        CustTrans custTrans;
        
        select sum(AmountCur) from custTrans
            where custTrans.AccountNum == this.AccountNum
            and custTrans.TransDate <= this.TransDate
            and custTrans.Voucher <= this.Voucher
            and custTrans.BillofExchangeStatus <= this.BillofExchangeStatus
            and custTrans.RecId <= this.RecId;
            
        return custTrans.AmountCur;
    }

    Some important things to consider:

    1) This operation can be really slow, because you will need to perform a select sum for each line based on the past lines.

    2) Create the display method on the table and use the SysClientCacheDataMethodAttribute.

    3) In the sample code, I used the fields from the AccountDateIdx index to sum the records, because this is the index used to sort records on the CustTrans form.

    4) Filtering and sorting on the form level won't reflect on the display field since the calculation is done on the table level. If the user applies any filters to the form or change the sort order, the information on this field will then be useless and misleading.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans