Running Balance Field

airamairam Member Posts: 88
hi all,
i'm quite new to NAV and i need to add a new column in the Vendor Ledger Entry Table to keep a running balance of the amount. i.e. "running balance" := "running balance" + amount .. but it keeps showing zeros when i run the table. how shall i go about it please? thanks a lot

Comments

  • garakgarak Member Posts: 3,263
    The amount field is a FLOWFIELD. That means, that i has no value are stored in the table self. It's is a referencefield with a calcformula to a other table (here Detailed Vendor Ledg. Entry) and to a field there (here also the Amount field in the table Detailed Vendor Ledg. Entry).

    So, what should the "Running balance" display? Why do you need it, whats the reason?
    Should this be the whole amount of the vendor?

    Regards
    Do you make it right, it works too!
  • airamairam Member Posts: 88
    the main request from the client is that when he views the vendor ledger entries from the vendor card he would see a running balance besides the amount, which yes eventually the last amount would be equal to the total amount

    and i need to do the same for the Item Ledger Entry on the Quantity field which is a normal decimal field..

    any help pls?

    thanks and regards
  • DaveTDaveT Member Posts: 1,039
    Hi Airam,

    It is possible but is a lot of work on the server - may cause major performance issues. What you do is in the OnAfterGetCurrentRecord - copy the filters of the record variable REC to a variable and loop through the variable until current record totaling the value. Display the value in the list form
    Dave Treanor

    Dynamics Nav Add-ons
    http://www.simplydynamics.ie/Addons.html
  • garakgarak Member Posts: 3,263
    it can run fast if the vendor has not a lot of entries and the table has not many records. But with the time .... it comes slower and slower ...... and your customer scream ...... So, tell him the pro and contra and ask if he need it really. Why he need it? only to have a history what was the amount before and after the posting? So you can also store this values in a separate field and fill these field in the posting codeunit. But this is also a lot of work (for example u must also handle the undo postings) and in my eyes these are not needed datas .....
    Do you make it right, it works too!
Sign In or Register to comment.