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

Role Center Error: The FieldClass... must be Normal

(1) ShareShare
ReportReport
Posted on by 184
Hello everyone!
 
I am trying to extend the Business Manager role center, specifically the wide cues. However, I am getting the error in the title (“Error: The FieldClass for the Remaining Amt. (LCY) field in the Cust. Ledger Entry table must be Normal..”) in place of the wide cues as soon as I add the "Open Customer Invoices Sum" field on the page, as shown below.
 
Still, there is no error when only adding the "Open Vendor Invoices Sum", even though this field also uses the same exact CalcFormula and is based on another flowfield. Why does it work in the case of "Vendor Ledger Entry"."Remaining Amt. (LCY)" but not in the case of sum("Cust. Ledger Entry"."Remaining Amt. (LCY)"?
 
Would appreciate some suggestions to get around this error. 
 
 
Many thanks!
 
tableextension 50205 "Activities Cue Ext" extends "Activities Cue"
{
    fields
    {
        field(50200; "Open Vendor Invoices Sum"; Decimal)
        {
            CalcFormula = sum("Vendor Ledger Entry"."Remaining Amt. (LCY)" where("Document Type" = filter(Invoice),
                                                             "Remaining Amount" = filter(> 0),
                                                             "Applies-to ID" = filter('')));
            Caption = 'Creditors (Total AP)';
            Editable = false;
            FieldClass = FlowField;
        }
        field(50201; "Open Customer Invoices Sum"; Decimal)
        {

            CalcFormula = sum("Cust. Ledger Entry"."Remaining Amt. (LCY)" where("Document Type" = filter(Invoice),
                                                             "Remaining Amt. (LCY)" = filter(> 0),
                                                             "Applies-to ID" = filter('')));
            Caption = 'Debtors (Total AR)';
            Editable = false;
            FieldClass = FlowField;
        }
        field(50202; "Overdue Customer Invoices Sum"; Decimal)
        {
            AutoFormatType = 1;
            Caption = 'Debtors - Overdue';
            FieldClass = FlowField;
            CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where(
                "Initial Entry Due Date" = field(upperlimit("Overdue Date Filter"))
            ));
        }
    }

}
 
 
pageextension 50241 "O365 Activities Ext" extends "O365 Activities"
{
    layout
    {
        addafter("Overdue Purch. Invoice Amount")
        {
            field("Open Vendor Invoices Sum"; Rec."Open Vendor Invoices Sum")
            {
                ApplicationArea = All;
                ToolTip = 'Summation of AP/outstanding vendor invoices';
            }
        }
        addafter("Open Vendor Invoices Sum")
        {
            field("Open Customer Invoices Sum"; Rec."Open Customer Invoices Sum")
            {
                ApplicationArea = All;
                ToolTip = 'Summation of AR/outstanding customer invoices';
            }
        }
    }
}
 
I have the same question (0)
  • Suggested answer
    Nyakinyua Profile Picture
    55 on at
    it is not possible to directly CALCFIELD a CALCFIELD. This is because FlowFields are essentially virtual fields whose values are calculated at runtime using a formula defined in their CalcFormula property. In this case the field Remaining Amt. (LCY) field in the Cust. Ledger Entry table is a Calcfield hence the reason why you're getting the error. It should be a normal field. Consider getting your amount from the Detailed Cust. Ledger Entry instead.

    I hope this helps.

    Best,
    Nyakinyua.
     
     field(14; "Remaining Amount"; Decimal)
            {
                AutoFormatExpression = Rec."Currency Code";
                AutoFormatType = 1;
                CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Cust. Ledger Entry No." = field("Entry No."),
                                                                             "Posting Date" = field("Date Filter")));
                Caption = 'Remaining Amount';
                Editable = false;
                FieldClass = FlowField;
            }
  • CU05061853-0 Profile Picture
    184 on at
    Thanks for your reply Nyakinyua.
     
    It does seem to be possible with CalcFormula = sum("Vendor Ledger Entry"."Remaining Amt. (LCY)", which is also a CALCFIELD(in table 25 "Vendor Ledger Entry" definition for the Remaining Amount field is: CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)"), yet it does not return an error when adding it to the activities cue as detailed in the original post. Why is this?
     
    I had also tried using the Detailed Cust. Ledger Entry instead as shown below, to no avail (incorrect filtering, just returns 0 on role center). I believe adding the Entry No & Date Filters to the "Activities Cue" tablextension by using a TableRelation or lookup is probably not correct, but otherwise I get compiler errors AL0186 of “Reference '"Entry No"' in application object 'Activities Cue' does not exist” & “Reference '"Date Filter"' in application object 'Activities Cue' does not exist”. 
     
    How would I correctly use the Detailed Cust. Ledg. Entry field to correctly sum up the Remaining Amount of all invoices in this context?
     
    fields
        {
            field(50200; "Open Vendor Invoices Sum"; Decimal)
            {
                CalcFormula = sum("Vendor Ledger Entry"."Remaining Amt. (LCY)" where("Document Type" = filter(Invoice),
                                                                 "Remaining Amount" = filter(> 0),
                                                                 "Applies-to ID" = filter('')));
                Caption = 'Creditors (Total AP)';
                Editable = false;
                FieldClass = FlowField;
            }
            field(50201; "Entry No"; Integer)
            {
                TableRelation = "Cust. Ledger Entry"."Entry No.";
                Caption = 'Entry No.';
            }
            field(50202; "Date Filter"; Date)
            {
                Caption = 'Date Filter';
                TableRelation = "Cust. Ledger Entry"."Date Filter";
            }
            field(50203; "Open Customer Invoices Sum"; Decimal)
            {
     
                CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Cust. Ledger Entry No." = field("Entry No"),
                                                                             "Posting Date" = field("Date Filter")));
                Caption = 'Debtors (Total AR)';
                Editable = false;
                FieldClass = FlowField;
            }
  • Suggested answer
    YUN ZHU Profile Picture
    95,748 Super User 2025 Season 2 on at
    I briefly tried your code and did not encounter the error you mentioned.
     
    Since the standard also uses flowfield, I don't think there will be this error.
     
    Thanks.
    ZHU
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,647 Super User 2025 Season 2 on at
    Hi, I checked on my end, and the same error occurred.
    Suggestion: Take reference from these two fields. By following these two fields, you will definitely achieve your goal.
     
  • CU05061853-0 Profile Picture
    184 on at
    Thanks for replying YUN ZHU!
     
    To be clear, the original error for the snippets you attached is not a compiler error; it is displayed on the role center home page in place of the wide cues:
     
     
    The standard table use case is for count() and not sum(); also it does not use the Remaining Amount fields explicitly. 
     
    sum() does however seem to work with "Sales (LCY)" and I wonder if it has anything to do with the SumIndexFields of the respective keys. I'm just not sure how to implement a solution for this; I understand that experimenting with SIFT could affect performance…?
     
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,647 Super User 2025 Season 2 on at
    As I suggested, take reference from those two fields and write the code accordingly.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,647 Super User 2025 Season 2 on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,647 Super User 2025 Season 2 on at

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 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans