2

I'm using the built in Web Service API in Sitefinity 10. I tried to filter all news items by their related data item/items with Odata, but it seems that it could not be done.

~/api/default/newsitems?$expand={related-data-field}&$filter={related-data-field}/any(c: c/Id eq 888ac18a-85c0-4259-9a3c-05f25e53b23e)

With such a query I get an error with "Value cannot be null.\r\nParameter name: type" message.

Is it even possible to filter by related data item with Odata in Sitefinity? Thanks.

Rostech
  • 322
  • 1
  • 11
  • 1
    Not sure about it's possibility but i know if you are using related items you have to check that type too when setting up the web service. Did you do that? – Jon R. Sep 28 '17 at 17:46

2 Answers2

2

A colleague of mine pointed out that Navigational properties of related types are not supported yet for filtering.

https://docs.sitefinity.com/manage-the-properties-of-a-type

Jon R.
  • 977
  • 6
  • 12
  • Thanks, Jon. We are looking forward to have this functionality. For now we implemented a workaround. – Rostech Oct 11 '17 at 06:40
  • 1
    We added an event listener in the EventHub for IDataEvent. `EventHub.Subscribe(Content_Action);` On Update we get the related data items Id's and store them in a long text field, or an array of guids. – Rostech Oct 18 '17 at 06:10
1

This is now supported with version 14.2.7921.0 of Sitefinity

gebov
  • 73
  • 6