Skip to main content

Notifications

Announcements

No record found.

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
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,622 Moderator on at
    Adding Or Condition in AOT Query Range
    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.
  • Layan Jwei Profile Picture
    7,722 Super User 2025 Season 1 on at
    Adding Or Condition in AOT Query Range
    Hi,
     
    Please don't forget to verify the answers that helped.
  • Layan Jwei Profile Picture
    7,722 Super User 2025 Season 1 on at
    Adding Or Condition in AOT Query Range
    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
  • Suggested answer
    Layan Jwei Profile Picture
    7,722 Super User 2025 Season 1 on at
    Adding Or Condition in AOT Query Range
    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
     
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    17,154 Super User 2025 Season 1 on at
    Adding Or Condition in AOT Query Range
    Hi,
     
    you must use || when you want to OR condition in query.
     
    Best regards,
    Mohamed Amine MAHMOUDI
  • Layan Jwei Profile Picture
    7,722 Super User 2025 Season 1 on at
    Adding Or Condition in AOT Query Range
    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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,916 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,782 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans