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 :
Microsoft Dynamics AX (Archived)

How to use multiple enum values as Query Filter

(0) ShareShare
ReportReport
Posted on by 130

Hi,

Any idea how to specify multiple enums as the filter options for a query

I've created a QueryBuildRange variable and I know that for one enum I can specify it like this

    criteria.value(QueryValue(ProjectStatus::ProjectOpen));

But what about when you want it to be either one of two possibilities???

I've tried these (but none of them appeared to compile)

criteria.value(QueryValue(ProjectStatus::ProjectOpen), QueryValue(ProjectStatus::ProjectDecided));
criteria.value(QueryValue(ProjectStatus::ProjectOpen, ProjectStatus::ProjectDecided));
criteria.value(QueryValue(ProjectStatus::ProjectOpen, ProjectDecided));

Anyone know where I'm going wrong?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    Simply add one more range:

    ds.addRange(...).value(queryValue(ProjectStatus::ProjectOpen));
    ds.addRange(...).value(queryValue(ProjectStatus::ProjectDecided));
  • Verified answer
    Kevin Roos Profile Picture
    265 on at

    Hi,

    Or try using the queryRangeConcat function.

    criteria.value(queryRangeConcat(criteria.value(), ProjectStatus::ProjectOpen));
    
    criteria.value(queryRangeConcat(criteria.value(), ProjectStatus::ProjectDecided));
  • Adam Duckworth Profile Picture
    130 on at

    Thanks for the replies. I thought I just needed to get the syntax right within QueryValue, but that was wrong. queryRangeConcat makes a lot more sense to me... how did I not see that method before?

    Thanks guys!

  • Kevin Roos Profile Picture
    265 on at

    Oh right, fixed it ;-)

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
GL-01081504-0 Profile Picture

GL-01081504-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans