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

Flow field issue

(2) ShareShare
ReportReport
Posted on by 213
Hello team,
 
in the below code am trying to get the total of line amount in both cases means GL account no = 1410301 and type = item (if type = item exits)then take the total of both otherwise if item is not present then total of only this gl acocunt.
 
Only facing issue in this line- "No." = CONST('1410301')| "Type" = CONST(Item)),
 
if i add one condition its working but i want in if it comes in both condition means if sum if gl code 1410301 and type = items comes
 
but am getting error. is anything i did wrong .pls suggest 
field(60012; "Total Job Project"; decimal)
        {
 
            FieldClass = FlowField;
            CalcFormula = - Sum("Job Ledger Entry"."Line Amount (LCY)" WHERE("Job No." = FIELD("No."),
                                                                             "Entry Type" = CONST(Sale),
                                                                             ("No." = CONST('1410301')| "Type" = CONST(Item)),
                                                                             "Posting Date" = FIELD("Posting Date Filter"),
                                                                             "Shortcut Dimension 3 Code" = const('PROJECTS')));
        }
 
 
 
 
  • BCUSER2024 Profile Picture
    213 on at
    Flow field issue
    i tried this also but still not getting the reulst
     
  • Suggested answer
    Ramesh Kumar Profile Picture
    5,404 on at
    Flow field issue
    logical operator | within the CalcFormula. The syntax you're using in the condition ("No." = CONST('1410301') | "Type" = CONST(Item)) is not valid in AL code for filtering the records based on two conditions combined with an OR operation. The | operator doesn't work directly inside the WHERE clause in this manner.
     
    ou need to specify multiple conditions separately for your Sum expression. Specifically, to sum amounts when either the GL account number ("No." = CONST('1410301')) or the Type ("Type" = CONST(Item)) condition is met, you should rewrite the condition like this:
     
    field(60012; "Total Job Project"; decimal)
    {
        FieldClass = FlowField;
        CalcFormula = -Sum("Job Ledger Entry"."Line Amount (LCY)" WHERE(
                                            "Job No." = FIELD("No."),
                                            "Entry Type" = CONST(Sale),
                                            "Posting Date" = FIELD("Posting Date Filter"),
                                            "Shortcut Dimension 3 Code" = CONST('PROJECTS'),
                                            ("No." = CONST('1410301') OR "Type" = CONST(Item))
                                            ));
    }
     
     
    If this was helpful, please check the "Does this answer your question?" box and mark it as verified.
  • BCUSER2024 Profile Picture
    213 on at
    Flow field issue
    pls let me know the way am approaching is right or i missed anything
  • BCUSER2024 Profile Picture
    213 on at
    Flow field issue
    hi
     
    error also attached
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    17,479 Super User 2025 Season 1 on at
    Flow field issue
    Which type of error?
  • Jainam M. Kothari Profile Picture
    9,044 on at
    Flow field issue
    May the Technical Expert can answer in a better way.

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