The problem I am facing is that the variable FASubclasstot is not resetting after the FA Subclass changes. It keeps accumulating from the prior class and its now acting as a running total.Help me how do I use the ONPRE DATA ITEM, ON AFTER GET Record and ON POST DATA
ON PREDATA ITEM - I put this code**********************
FA_Appreciation_Tot:=0;
FA_Acquistion_Tot:=0;
FA_Depreciation_Tot:=0;
FA_Disposal_Tot:=0;
FA_Writedown_Tot:=0;
FA_NBV_Tot:=0;
FASubclassNum:="Fixed Asset"."FA Class Code";
ON After GETRECORD************************************
IF FASubclassNum="Fixed Asset"."FA Class Code" THEN
"FA Depreciation Book".RESET;
"FA Depreciation Book".SETFILTER("FA No.","Fixed Asset"."No.");
"FA Depreciation Book".SETRANGE("FA No.","Fixed Asset"."No.");
BEGIN
FA_Acquistion_Tot:="Acquisition Cost"+FA_Acquistion_Tot ;
FA_Appreciation_Tot:=Appreciation+FA_Appreciation_Tot;
FA_Depreciation_Tot:=Depreciation+FA_Depreciation_Tot;
FA_Writedown_Tot:="FA Depreciation Book"."Write-Down"+FA_Writedown_Tot;
FA_Disposal_Tot:= "Proceeds on Disposal"+FA_Disposal_Tot;
// FA_NBV_Tot:= "Book Value" + FA_NBV_Tot;
FA_NBV_Tot:=FA_Acquistion_Tot+FA_Appreciation_Tot+FA_Disposal_Tot+FA_Depreciation_Tot+FA_Writedown_Tot
END;
IF FASubclassNum <>"Fixed Asset"."FA Class Code" THEN
BEGIN
FASubclassGrpTot:=0;
FA_Appreciation_Tot:=0;
FA_Acquistion_Tot:=0;
FA_Depreciation_Tot:=0;
FA_Disposal_Tot:=0;
FA_NBV_Tot:=0;
FASubclassNum:="Fixed Asset"."FA Class Code"
END;
ON POST DATA----no code
0
Answers