Announcements
Hello:
I have an AOT query which has a datasource node pointed to InventTrans. I'd like to add a Ranges conditional where StatusIssue = 1 OR StatusReceipt = 1. I assume adding two Ranges with each pointed to a specific field and value would equate to an AND. Thank you!
Isn't an union query the best solution in your case?
The query is actually already wrapped in a View. The view is called from X++ code. I'm hoping to just add the Range to the query, but worst case, I can filter it out after calling the view, but probably not best approach to limit records returned.
Hi Ichiban,
Where you using this query?
Wherever you using this AOT query, you can apply ranges by getting query.
Query q = new Query(queryStr('AOTQueryName'));
As explained above you can then apply complex ranges using Expression, but yours look simple
Please check,
I'm not sure I understand. My issue is with an AOT query; I'm not building X++ code.
Hi Ichiban,
Your confusion is similar to this thread, you can look at Martin's detailed explanation.
community.dynamics.com/.../addrange-with-and-and-or-conditions
Just to clarify, so if I add a Ranges node to my AOT query, I can then simply add an expression such as
((StatusIssue == 1) || (StatusReceipt == 1))
So regardless of which of the two fields I choose in the Field property, I can still reference the other?
It can be done by Using Expressions in Query Ranges.
Alternatively you could use a union query (combining one selection for StatusIssue and one for StatusReceipt), or you could create a view with a computed column (combining StatusIssue and StatusReceipt) and filtering by this computed column.
André Arnaud de Cal...
293,296
Super User 2025 Season 1
Martin Dráb
232,093
Most Valuable Professional
nmaenpaa
101,156
Moderator