Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Suggested answer

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

Posted on by 125
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';
            }
        }
    }
}
 
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 1,999 on at
    Role Center Error: The FieldClass... must be Normal
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 1,999 on at
    Role Center Error: The FieldClass... must be Normal
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    Khushbu Rajvi. 1,999 on at
    Role Center Error: The FieldClass... must be Normal
    As I suggested, take reference from those two fields and write the code accordingly.
  • CU05061853-0 Profile Picture
    CU05061853-0 125 on at
    Role Center Error: The FieldClass... must be Normal
    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
    Khushbu Rajvi. 1,999 on at
    Role Center Error: The FieldClass... must be Normal
    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.
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 70,191 Super User 2024 Season 2 on at
    Role Center Error: The FieldClass... must be Normal
    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
  • CU05061853-0 Profile Picture
    CU05061853-0 125 on at
    Role Center Error: The FieldClass... must be Normal
    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
    Nyakinyua Profile Picture
    Nyakinyua 45 on at
    Role Center Error: The FieldClass... must be Normal
    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;
            }

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,570 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,683 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans