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

Announcements

No record found.

News and Announcements icon
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
    152 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

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

#2
YUN ZHU Profile Picture

YUN ZHU 1,148 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 557 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans