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

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 
I have the same question (0)
  • Gerardo Rentería García Profile Picture
    25,390 Most Valuable Professional on at
    Hi
    Do you get an error? Or do you get a wrong quantity?
    BR
    GR
  • Suggested answer
    Dynamics_Decoded_Gokul Profile Picture
    478 on at
    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;
            }
  • Verified answer
    Mounir M Profile Picture
    37 on at
    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 
     

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

#2
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 764 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 635 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans