Filtering ODataV4 with list of values

TallyHo
Member Posts: 417
Hi,
I exposed a query in Web Services (query object added below).
I want to filter on multiple selected GLACC's. According to
https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/use-filter-expressions-in-odata-uris
this is possible:
"In a list of values $filter=EntryNo in (610, 612, 614)
Query that returns entry numbers 610, 612, and 614"
So, I call the odatav4 api on my docker with.
http://bc24:7048/BC/ODataV4/Company('CRONUS Nederland BV')/GLTotals?$filter=GLACC_FilterOnly in ('7200', '7250')
But it just ignores the filter values for glacc's 7250 and 7200. It doesn't throw an error,
it just returns the aggregated totals for all glacc's.
Using the other filter methods presented in the dev-itpro page, do work.
Does anybody here know what am I overseeing?
query 50000 "G/L Totals"
{
QueryType = Normal;
elements
{
dataitem(GLEntryTotals; "G/L Entry")
{
filter(GLACC; "G/L Account No.")
{
}
filter("DATE"; "Posting Date")
{
}
filter(GDM1; "Global Dimension 1 Code")
{
}
filter(GDM2; "Global Dimension 2 Code")
{
}
column(GlobalDimension1Code; "Global Dimension 1 Code")
{
}
column(GlobalDimension2Code; "Global Dimension 2 Code")
{
}
column(Amount; Amount)
{
Method = sum;
}
}
}
}
I exposed a query in Web Services (query object added below).
I want to filter on multiple selected GLACC's. According to
https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/use-filter-expressions-in-odata-uris
this is possible:
"In a list of values $filter=EntryNo in (610, 612, 614)
Query that returns entry numbers 610, 612, and 614"
So, I call the odatav4 api on my docker with.
http://bc24:7048/BC/ODataV4/Company('CRONUS Nederland BV')/GLTotals?$filter=GLACC_FilterOnly in ('7200', '7250')
But it just ignores the filter values for glacc's 7250 and 7200. It doesn't throw an error,
it just returns the aggregated totals for all glacc's.
Using the other filter methods presented in the dev-itpro page, do work.
Does anybody here know what am I overseeing?
query 50000 "G/L Totals"
{
QueryType = Normal;
elements
{
dataitem(GLEntryTotals; "G/L Entry")
{
filter(GLACC; "G/L Account No.")
{
}
filter("DATE"; "Posting Date")
{
}
filter(GDM1; "Global Dimension 1 Code")
{
}
filter(GDM2; "Global Dimension 2 Code")
{
}
column(GlobalDimension1Code; "Global Dimension 1 Code")
{
}
column(GlobalDimension2Code; "Global Dimension 2 Code")
{
}
column(Amount; Amount)
{
Method = sum;
}
}
}
}
0
Best Answer
Answers
-
Seems like in operator is newly added.
I will update my docker container to the latest v24.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions