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

How to use OR in a 'case' or 'if' statement in AL?

(0) ShareShare
ReportReport
Posted on by 481

I get this error:
Operator 'OR' cannot be applied to operands of type 'Text' and 'Text'

When I try to write this if statement in AL:
if ActivityNo = 'DA' OR 'SA' then begin
end;

Is there no way of using logical disjunction between text?

I have the same question (0)
  • Suggested answer
    JAngle Profile Picture
    133 on at

    Try it as

    if (ActivityNo = ‘DA’) or (ActivityNo = ‘SA’)

  • jdrco Profile Picture
    481 on at

    Good to know. Any way to use OR in a case statement? (just for future reference)

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

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans