Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to pass two enum values in Query filter using x++

(0) ShareShare
ReportReport
Posted on by 535

Hi All,

How to pass two enum value into query filter using x++?

For e.g: In PO, we have status (Open order, invoiced, received). I want to see only invoiced and received. if i click one check box, it has to show only "Received"&"invoiced" status.

For this, i need to pass two enum values instead on passing string value to filter the same.

Help me here if anyone knows. 

  • Verified answer
    Blue Wang Profile Picture
    on at
    RE: How to pass two enum values in Query filter using x++

    HI Vignesh,

    If you use Global::queryRangeConcat.

    I think it should like:

    queryBuildRange.value(Global::queryRangeConcat(queryValue(enum2str(xx::Received), enum2str(xx::Invoiced))));

    OR

    queryRangeConcat(SysQuery::value(xx::Received), SysQuery::value(xx::Invoiced))ï¼›

    
                          
  • Vignesh R Profile Picture
    535 on at
    RE: How to pass two enum values in Query filter using x++

    Hi,

    I got my solution using below using query

    queryBuildRange.value(Global::queryRangeConcat(enum2str(xx::Received), enum2str(xx::Invoiced)));

    thanks for your help.

  • Blue Wang Profile Picture
    on at
    RE: How to pass two enum values in Query filter using x++

    HI Vignesh,

    Use strFmt().

    queryBuildRange.value(strFmt('%1,%2', enum2str(ABC::A),enum2Str(ABC::B)));

  • Vignesh R Profile Picture
    535 on at
    RE: How to pass two enum values in Query filter using x++

    I'm getting an error(The wrong number of arguments has been specified for the function.)

    If use above code.

  • Blue Wang Profile Picture
    on at
    RE: How to pass two enum values in Query filter using x++

    Hi Vignesh,

    You can try to use

    queryBuildRange.value(enum2str(XX::Received),enum2str(XX::Invoiced));

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 565

#2
Martin Dráb Profile Picture

Martin Dráb 536 Most Valuable Professional

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 402 Super User 2025 Season 1

Product updates

Dynamics 365 release plans