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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Adding Or Condition in AOT Query Range

(2) ShareShare
ReportReport
Posted on by 41
 
 
Hi All,
Hope you are doing Well, Just a simple question,  How to add AOT query range with OR condition with 2 different fields?
 
Any sample code or example will be helpful..
 
Thanks
  • Layan Jwei Profile Picture
    8,428 Super User 2026 Season 2 on at
    Hi,
     
    I don't think I understand what you are trying to achieve. Can you please rephrase it?
     
    Or if you could write an x++ code or sql scripts that returns your required result then maybe I can help you more
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,828 Super User 2026 Season 1 on at
    Hi,
     
    you must use || when you want to OR condition in query.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Suggested answer
    Layan Jwei Profile Picture
    8,428 Super User 2026 Season 2 on at
    Hi,

    I assume you edited the question because now it's clearer.

    let's assume your AOT query has table1. And you want to filter on field1 or field2.

    what you need to do, is just add a range for one of those fields only. Let's say field1, then in the range value fill it with this: ((Field1 == "123") || (Field2 == "ABC"))   

    each range needs to be in parenthesis, and you can add more than one field in the range value even though you only added range for field1. 

    Try it and it will work

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
     
  • Layan Jwei Profile Picture
    8,428 Super User 2026 Season 2 on at
    Hi,

    Is your question answered, if yes then please verify the answers that helped


    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Layan Jwei Profile Picture
    8,428 Super User 2026 Season 2 on at
    Hi,
     
    Please don't forget to verify the answers that helped.
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    This is one of the way 
     
     
    In other way, from where the AOT query is being called, there you can call addrange method and pass the ranges as values.

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 Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 266 Super User 2026 Season 2

#2
Aayush Tiwari Profile Picture

Aayush Tiwari 217

#3
Subra Profile Picture

Subra 164 Super User 2026 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans