web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Fixed Asset Book Value

(0) ShareShare
ReportReport
Posted on by 224

Hello All,

am trying to bring some fields into the "FA Ledger Entries List page" all of the values are coming correct except the Book value (which is coming from the table of 

"FA Depreciation Book"
the field field Book values is coming the 0 Values. pls let me know the issues in this.
fa-table.jpg
fa-value.jpg
pageextension 60027 "Fixed Asset Leg Entries" extends "FA Ledger Entries"
{
    layout
    {
        addafter("FA No.")
        {
            field("FA Class Code"; Rec."FA Class Code")
            {
                ApplicationArea = All;
                Width = 12;
            }
            field("Depreciation Starting Date"; Rec."Depreciation Starting Date")
            {
                ApplicationArea = All;
                Caption = 'Deprec Start Dt';
            }
            field("Depreciation Ending Date"; Rec."Depreciation Ending Date")
            {
                ApplicationArea = All;
                Caption = 'Deprec End Dt';
            }
            field("Depr. % this year (Custom 1)"; Rec."Depr. % this year (Custom 1)")
            {
                ApplicationArea = All;
                Visible = false;
            }
            field(Bookvalues; Bookvalues)
            {
                ApplicationArea = all;
                Caption = 'Curr Book Value';
            }
        }
        addafter("Document Type")
        {
            field("Document Date"; Rec."Document Date")
            {
                ApplicationArea = All;
                Width = 12;
            }
        }
        moveafter("FA Posting Date"; "Posting Date")
        modify("Posting Date")
        {
            Visible = false;
        }
        moveafter("FA Class Code"; Description)
        modify("Document No.")
        {
            Width = 16;
        }
    }

    trigger OnAfterGetRecord();
    var
        FixedAsset: Record "FA Depreciation Book";
    begin
        FixedAsset.Reset();
        FixedAsset.SetRange("Book Value", Bookvalues);
        Bookvalues := FixedAsset."Book Value";
    end;

    var
        Bookvalues: Decimal;

}
I have the same question (0)
  • Suggested answer
    Javier.Armesto Profile Picture
    14 User Group Leader on at

    If it is a calculated field you will have to perform Calcfields on the field.

    If the answer has helped you mark as verified and thus we help other users who have the same problem

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    In your OnAfterGetRecord trigger please add

    FixedAsset.Calcfields("Book Value");

    And your setrange will fail if you have more than one FA with the same book value. So i would modify that to get the FA for the current record instead.

    So you can probably change all your code to only these two lines in the trigger

    CurrRec.calcfield("Book Value");

    BookValues := CurrRec."Book Value";

  • Suggested answer
    divyeshchitte Profile Picture
    968 on at

    Kindly Add 

    Calcfield("Book value") on trigger onaftergetrec as this is flowfield

  • LearnBC Profile Picture
    224 on at

    still am not getting the value. is there any wrong on this

    pageextension 60027 "Fixed Asset Leg Entries" extends "FA Ledger Entries"
    {
        layout
        {
            addafter("FA No.")
            {
                field("FA Class Code"; Rec."FA Class Code")
                {
                    ApplicationArea = All;
                    Width = 12;
                }
                field("Depreciation Starting Date"; Rec."Depreciation Starting Date")
                {
                    ApplicationArea = All;
                    Caption = 'Deprec Start Dt';
                }
                field("Depreciation Ending Date"; Rec."Depreciation Ending Date")
                {
                    ApplicationArea = All;
                    Caption = 'Deprec End Dt';
                }
                field("Depr. % this year (Custom 1)"; Rec."Depr. % this year (Custom 1)")
                {
                    ApplicationArea = All;
                    Visible = false;
                }
                field(Bookvalues; Bookvalues)
                {
                    ApplicationArea = all;
                    Caption = 'Curr Book Value';
                }
            }
            addafter("Document Type")
            {
                field("Document Date"; Rec."Document Date")
                {
                    ApplicationArea = All;
                    Width = 12;
                }
            }
            moveafter("FA Posting Date"; "Posting Date")
            modify("Posting Date")
            {
                Visible = false;
            }
            moveafter("FA Class Code"; Description)
            modify("Document No.")
            {
                Width = 16;
            }
        }
    
        trigger OnAfterGetRecord();
        var
            FixedAsset: Record "FA Depreciation Book";
            
    
        begin
            FixedAsset.Reset();
            //FixedAsset.SetRange("Book Value", Bookvalues);
            //Bookvalues := FixedAsset."Book Value";
            FixedAsset.CalcFields("Book Value");
            BookValues := FixedAsset."Book Value";
            
        end;
    
        var
            Bookvalues: Decimal;
    
    }

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Hi,

    Please change the below code

       trigger OnAfterGetRecord()

       var

           FADeprBook: Record "FA Depreciation Book";

       begin

           FADeprBook.Reset();

           FADeprBook.SetRange("FA No.", rec."FA No.");

           FADeprBook.SetRange("Depreciation Book Code", rec."Depreciation Book Code");

           if FALedgEntry.findset then begin

               FADeprBook.CalcFields("Book Value");

               bookvalues := FADeprBook."Book Value";

           end;

       end;

  • LearnBC Profile Picture
    224 on at

    Still its not working

    pageextension 60027 "Fixed Asset Leg Entries" extends "FA Ledger Entries"
    {
        layout
        {
            addafter("FA No.")
            {
                field("FA Class Code"; Rec."FA Class Code")
                {
                    ApplicationArea = All;
                    Width = 12;
                }
                field("Depreciation Starting Date"; Rec."Depreciation Starting Date")
                {
                    ApplicationArea = All;
                    Caption = 'Deprec Start Dt';
                }
                field("Depreciation Ending Date"; Rec."Depreciation Ending Date")
                {
                    ApplicationArea = All;
                    Caption = 'Deprec End Dt';
                }
                field("Depr. % this year (Custom 1)"; Rec."Depr. % this year (Custom 1)")
                {
                    ApplicationArea = All;
                    Visible = false;
                }
                field(Bookvalues; Bookvalues)
                {
                    ApplicationArea = all;
                    Caption = 'Curr Book Value';
                }
            }
            addafter("Document Type")
            {
                field("Document Date"; Rec."Document Date")
                {
                    ApplicationArea = All;
                    Width = 12;
                }
            }
            moveafter("FA Posting Date"; "Posting Date")
            modify("Posting Date")
            {
                Visible = false;
            }
            moveafter("FA Class Code"; Description)
            modify("Document No.")
            {
                Width = 16;
            }
        }
        trigger OnAfterGetRecord()

        var

            FADeprBook: Record "FA Depreciation Book";

        begin

            FADeprBook.Reset();

            FADeprBook.SetRange("FA No.", rec."FA No.");

            FADeprBook.SetRange("Depreciation Book Code", rec."Depreciation Book Code");

            if FALedgEntry.findset then begin

                FADeprBook.CalcFields("Book Value");

                bookvalues := FADeprBook."Book Value";

            end;

        end;

        var
            Bookvalues: Decimal;

    }
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Sorry my bad, Please change below.

    trigger OnAfterGetRecord()

       var

           FADeprBook: Record "FA Depreciation Book";

       begin

           FADeprBook.Reset();

           FADeprBook.SetRange("FA No.", rec."FA No.");

           FADeprBook.SetRange("Depreciation Book Code", rec."Depreciation Book Code");

           if FADeprBook.findset then begin

               FADeprBook.CalcFields("Book Value");

               bookvalues := FADeprBook."Book Value";

           end;

       end;

  • LearnBC Profile Picture
    224 on at

    Yes Nithin..its working perfect as expected.

    Thankyou for your support always

  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Good to know

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,229

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,867 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans