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

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)
  • Jainam M. Kothari Profile Picture
    15,627 Super User 2025 Season 2 on at
    May the Technical Expert can answer in a better way.
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    20,234 Super User 2025 Season 2 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,527 Super User 2025 Season 2 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
     

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

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,467 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,435 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans