web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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')));
        }
 
 
 
 
error.jpg
I have the same question (0)
  • Jainam M. Kothari Profile Picture
    15,959 Super User 2026 Season 1 on at
    May the Technical Expert can answer in a better way.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,342 Super User 2026 Season 1 on at
    Which type of error?
  • BCUSER2024 Profile Picture
    213 on at
    hi
     
    error also attached
  • BCUSER2024 Profile Picture
    213 on at
    pls let me know the way am approaching is right or i missed anything
  • Suggested answer
    Ramesh Kumar Profile Picture
    7,549 Super User 2026 Season 1 on at
    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
    i tried this also but still not getting the reulst
     
    errorrs.jpg

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,059 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 994 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 664 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans