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 customize "sales this Month" cue based on the current user.

(0) ShareShare
ReportReport
Posted on by 76
Hi,
 
My client requirement is to show "sales this month" based on the sales done by himself. How to set filter for the same?
 
So wrote a code like below: but getting Error: The following fields must have the same type:Field: User ID <-- Created By

Table: Cust. Ledger Entry <-- Activities Cue

Type: Code <-- GUID.
 
but both user ID and created by fields are GUID data type only.
 
 field(70000; SalesThisMonth; Decimal)
        {
            FieldClass = FlowField;
            //CalcFormula = sum("Cust. Ledger Entry"."Sales (LCY)" where("Document Type" = filter(Invoice), "Posting Date" = filter('-1Y' .. 'CD')));
            CalcFormula = sum("Cust. Ledger Entry"."Sales (LCY)" where("Document Type" = filter(Invoice), "Posting Date" = filter('CM'), "User ID" = field(SystemCreatedBy)));
            Caption = 'Sales Amount This Month';
            AutoFormatExpression = GetAmountFormat();
            AutoFormatType = 11;
            DecimalPlaces = 0 : 0;
        }
I have the same question (0)
  • Suggested answer
    Umut Dogan Koc Profile Picture
    87 on at
    Hello,
     
    Must it be a flow field? You can create a normal field and make calculation on a trigger instead of using a flow field.
  • Suggested answer
    Gerardo Rentería García Profile Picture
    25,213 Most Valuable Professional on at
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,363 Super User 2025 Season 2 on at
    For the decimal datatype there is the another process for the filter. you cant directly use if data type is decimal.


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