Skip to main content
Solved

Can I filter on array elements a saved query (ODATA capabilities in 22R1)?


Kenneth Pettersson CGI
Sidekick (Partner)
Forum|alt.badge.img+7

References can be used in filters and are also expandable items. Hence, we can have a saved query that filters on a value in a reference. Example: find the inventory parts for planner with name ‘Kenneth Pettersson’. Odata string would look like this:

<your server stuff>/main/ifsapplications/projection/v1/InventoryPartHandling.svc/InventoryPartSet?$select=Contract,PartNo,PlannerBuyer&$filter=PlannerBuyerRef/BuyerName eq 'Kenneth Pettersson'

And I can use “PlannerBuyerRef/BuyerName eq 'Kenneth Pettersson'” in the Advanced option for a saved query, or in a lobby data source based on a projection.

In theory, Odata 4.0 would support filtering also on array contents, I think. But any way I try, I either get syntax error or ODP_NOT_IMPLEMENTED messages.

E g this “should” work according to the Odata 4.0 documentation:

<your server stuff>/main/ifsapplications/projection/v1/ShopOrderHandling.svc/ShopOrds?$filter=MaterialArray/$count lt 10

Response: 

{"error":{"code":"ODP_NOT_IMPLEMENTED","message":"Unsupported operation."}}

Filtering on array content would be very useful for advanced queries. Is this going to be supported, is it not supposed to be, or am I doing it the wrong way?

The technical documentation for 21R2 contained some information about supported and not supported parts of the Odata standard, but I did not find anything here:

https://docs.ifs.com/techdocs/22r1/060_development/022_user_interface/030_aurena_dev/010_aurena_overview/

Just a reference to Odata 4.0.

Best answer by chanaka-shanil

Unfortunately, this kind of operations against Array Reference are not supported. We have documented some information here: Supported Functionalities - Technical Documentation For IFS Cloud but it’s missing mentioning this. I will update the documentation.

Basically we currently don’t support Lambda Operations (used to filter arrays). $count is support but not in combination with $filter.

We have an item to improve this area and I will add this to it.

To get around this for now, one option would be to define a Custom Attribute on the parent and then use that for the filtering 

View original
Did this topic help you find an answer to your question?

2 replies

chanaka-shanil
Superhero (Employee)
Forum|alt.badge.img+15
  • Superhero (Employee)
  • 166 replies
  • Answer
  • August 22, 2022

Unfortunately, this kind of operations against Array Reference are not supported. We have documented some information here: Supported Functionalities - Technical Documentation For IFS Cloud but it’s missing mentioning this. I will update the documentation.

Basically we currently don’t support Lambda Operations (used to filter arrays). $count is support but not in combination with $filter.

We have an item to improve this area and I will add this to it.

To get around this for now, one option would be to define a Custom Attribute on the parent and then use that for the filtering 


PhillBronson
Hero (Customer)
Forum|alt.badge.img+11
  • Hero (Customer)
  • 120 replies
  • February 21, 2025

@chanaka-shanil any improvements in this area?

Same question as ​@Kenneth Pettersson CGI but we’re in 24r1 now. Maybe the docs could be update at least?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings