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...
Suggested Answer

How to extend a CalcFormula in a TableExtension

(0) ShareShare
ReportReport
Posted on by 5

We'd like to set a custom filter on the Field `Acquisition Cost`. The current CalcFormula is

 field(15; "Acquisition Cost"; Decimal)
{
    AutoFormatType = 1;
    CalcFormula = Sum("FA Ledger Entry".Amount WHERE("FA No." = FIELD("FA No."),
                                                      "Depreciation Book Code" = FIELD("Depreciation Book Code"),
                                                      "FA Posting Category" = CONST(" "),
                                                      "FA Posting Type" = CONST("Acquisition Cost"),
                                                      "FA Posting Date" = FIELD("FA Posting Date Filter")));
    Caption = 'Acquisition Cost';
    Editable = false;
    FieldClass = FlowField;
}


We'd like to have it something like this:
 field(15; "Acquisition Cost"; Decimal)
{
    AutoFormatType = 1;
    CalcFormula = Sum("FA Ledger Entry".Amount WHERE("FA No." = FIELD("FA No."),
                                                      "Depreciation Book Code" = FIELD("Depreciation Book Code"),
                                                      "FA Posting Category" = CONST(" "),
                                                      "FA Posting Type" = CONST("Acquisition Cost" | "OUR CUSTOM VALUE"), // <<- Add this
                                                      "FA Posting Date" = FIELD("FA Posting Date Filter")));
    Caption = 'Acquisition Cost';
    Editable = false;
    FieldClass = FlowField;
}

Is there any way to do this? Thanks for your help

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Hi,

    As of now there is no way to customize calcformula, but there is workaround you can use, please refer below link

    community.dynamics.com/.../workaround-to-modify-standard-table-field-calcformula

  • Suggested answer
    Steven Renders Profile Picture
    5,672 Moderator on at

    Calcformula is a property that can not be extended:

    docs.microsoft.com/.../devenv-table-properties

    You have to create a new field instead.

  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at

    Hi, As mentioned by several experts above, the property 'CalcFormula' cannot be customized.

    So, please hide the existing field and create a new one.

    pastedimage1654136397986v1.png

    Hope this helps as well.

    Thanks.

    ZHU

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,143

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans