Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Flow field issue

(3) 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
    2,469 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
    13,316 Super User 2025 Season 1 on at
    Flow field issue
    Which type of error?
  • Jainam M. Kothari Profile Picture
    4,579 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,709 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,679 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans