Quantcast
Channel: Microsoft Dynamics NAV
Viewing all articles
Browse latest Browse all 64865

Forum Post: Total sum problem

$
0
0
Dear Experts, I have write a mail code for show the total cost based on its inventory posting group and unit(global dimension code 1). But in output always comes up the single value. Please help me to short this. My base table is "Value Entry". In value entry there have multiple inventory posting group but in my output only come the single posting group. Please find the cost details summary: Item Group Unit Total Cost Amount Raw Material 101 822,918,144.31 My code is below: Mail.CreateMessage('ABC Limited','nav@ABC.com','manish.yadav@abc.com','Stock Valuation Report','',TRUE) ; Mail.AppendBody('Dear Sir / Madam,'); Mail.AppendBody(' '); Mail.AppendBody('Please find the cost details summary:'); Mail.AppendBody(' '); Mail.AppendBody(' '); Mail.AppendBody(' '); Mail.AppendBody(' Item Group '); Mail.AppendBody(' Unit '); Mail.AppendBody(' Total Cost Amount '); Mail.AppendBody(' '); TotalCostValue:=0; ValueEntry.RESET; ValueEntry.SETFILTER(ValueEntry."Posting Date",'%1..%2',0D,TODAY); IF ValueEntry.FINDFIRST THEN BEGIN ValueEntry.CALCSUMS("Cost Amount (Actual)"); ValueEntry.CALCSUMS("Cost Amount (Expected)"); TotalCostValue := ValueEntry."Cost Amount (Actual)"+ValueEntry."Cost Amount (Expected)"; END; InventoryPostingGroup.RESET; InventoryPostingGroup.SETRANGE(Code, ValueEntry."Inventory Posting Group"); IF InventoryPostingGroup.FINDFIRST THEN BEGIN Mail.AppendBody(' '+FORMAT(InventoryPostingGroup.Description)+' '); END; Mail.AppendBody(' '+FORMAT(ValueEntry."Global Dimension 1 Code")+' '); Mail.AppendBody(' '+FORMAT(TotalCostValue)+' '); Mail.AppendBody(' '); Mail.AppendBody(' '); Mail.AppendBody(' '); Mail.AppendBody(' From '); Mail.AppendBody(' '); Mail.AppendBody('NAVISION (ERP) System'); Mail.AppendBody(' '); Mail.AppendBody('This is a system generated mail. Please do not reply to this email ID.'); Mail.Send;

Viewing all articles
Browse latest Browse all 64865

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>