guys hello
i try to show the new balance and old balance of the customer in a sales invoice.
for the new balance i tried 1 option were i put on the trigger( on get after record) in customer dataitem (someone told me that) the functions customer.CALCFIELDS("BALANCE(LCY)"); but i get 0.00
do you hane any clues?
also about old balance what formula i can use. I think i will be like BALANCE(LCY) - INVOICE AMOUNT but i do not know how
thanks in advance
george
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
But dont' put that to the report: two months later you get a furious call from the client, because they reprinted an old invoice and the balance was totally wrong.
Instead, put that into fields to the posted sales invoce header. Create the two new fields. Go to codeunit 80, search for INSERT and you will find where a posted sales invoice is inserted. Then, you can fill these fields there with code like this (just an example):
IF Cust.GET(SalesHeader."Sell-to Customer No.") THEN BEGIN
Cust.CALCFIELDS("Balance (LCY)");
SalesInvHeader.VALIDATE("Old Balance", Cust."Balance (LCY)-SalesInvHeader.Amount");
SalesInvHeader.VALIDATE("New Balance",Cust."Balance (LCY)");
END;
(posting the balance happened earlier thant inserting the invoice header)
Do It Yourself is they key. Standard code might work - your code surely works.
Do It Yourself is they key. Standard code might work - your code surely works.