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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

If true in [Condition1, Condition2] then exit;

(4) ShareShare
ReportReport
Posted on by 51
I have the below code.
 
 
On a docker container, the code runs fine, if Condition1 is false but condition 2 is true, it exits. However, when running on a SaaS environment, the exit is not getting hit even though it should.
Has anyone ever come across this before?
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    101,995 Super User 2026 Season 1 on at
    Hi,  Try using the AND keyword, for example,
    if (x = y) and (a = b) then begin
    x := a;
    y := b;

    end;
     
    Thanks.
    ZHU
  • Verified answer
    OussamaSabbouh Profile Picture
    17,623 Super User 2026 Season 1 on at
    Hello,
    Yes, I’ve seen similar confusion, but it’s usually not SaaS “ignoring” exit; it’s normally the IF condition being evaluated differently than expected, especially when and/or/not are mixed without brackets, or when SaaS is on a different runtime/app version than the container. In AL, and has higher precedence than or, so I’d rewrite it with explicit parentheses and split the test while debugging, for example: Condition1Value := Condition1; Condition2Value := Condition2; if (not Condition1Value) and Condition2Value then exit;. Also confirm the container is on the same BC/runtime version as SaaS, because Docker often isn’t an exact match unless you pinned the artifact version. I’d treat this as a condition/version issue first, not an exit bug.
    Regards,
    Oussama Sabbouh

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May 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,050 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,441 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 1,175 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans