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

CalcFormula

(1) ShareShare
ReportReport
Posted on by 37
Hello , 
 
I have  create flowfield in table customer to calculate  the number of elements in the Cust table. Ledger 
 
    field(50001; "Nb doc over 30d"; Integer)
        {
           FieldClass = FlowField;                  
           CalcFormula = count ("Cust. Ledger Entry" where ("Posting Date" <= (Today()-30D) ) );
           }
 
My Issue is CalcFormula doesn't work ?
 
 
the issur is : 
 
 
Thanks for any help 
  • Verified answer
    Mounir M Profile Picture
    37 on at
    CalcFormula
    Thanks for your answer
     
    I have declared 3 FlowField fileds like this  in table Customer:
     
     
    after I have add trigger OnAfterGetRecord on page Customer List : 
     
     
    the calculation is perfect 
     
    my issue is : in  the details when i click on "Nb doc over 30d" or "Nb doc over 60d" or "Nb doc over 90d"  it show the same filter 
     
     
     
    it take the last data filter passed  (Rec.SetFilter("Date Filter", '<=%1', DMY2DATE(01, 02, 2022));)
     
    the Document date must be show the date passed in argumnet 
     
    Any idea 
     
    Thanks 
     
  • Suggested answer
    Tech_BC_Gokul Profile Picture
    331 on at
    CalcFormula
    Hi 

    Please flowfilter concept to avoid this error 

    1. Create a flowfilter for date add that to your calcformula. 
    2. Where ever you require page. OnOpen and onAftergetrecord trigger add the code for passing the values to the flowfilter. 
    3. which will result you the Required output 
     
    field(50001; "Nb doc over 30d"; Integer)
            {
                FieldClass = FlowField;
                CalcFormula = count("Cust. Ledger Entry" where("Posting Date" = Field("Date Filter")));
            }
            field(50002; "Date Filter"; Date)
            {
                FieldClass = FlowFilter;
            }
  • Gerardo Rentería García Profile Picture
    20,891 Most Valuable Professional on at
    CalcFormula
    Hi
    Do you get an error? Or do you get a wrong quantity?
    BR
    GR

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans