web
You’re offline. This is a read only version of the page.
close
Skip to main content
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')));
        }
 
 
 
 
I have the same question (0)
  • 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
    7,503 Super User 2025 Season 2 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
    19,085 Super User 2025 Season 2 on at
    Flow field issue
    Which type of error?
  • Jainam M. Kothari Profile Picture
    12,116 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
Sumit Singh Profile Picture

Sumit Singh 2,857

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 2,687 Super User 2025 Season 2

#3
Jeffrey Bulanadi Profile Picture

Jeffrey Bulanadi 2,203

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans