HOME DOCUMENTATION DOWNLOADS BLOG

Conditional filtering of parent entity

I need to filter BusinessPartner entity by its child BusinessPartnerRole only in particular form (or for particular role/s).
In this case I need to show only suppliers to the warehouseman.

I created the filter GetProducersOrSuppliers on BusinessPartnerRole.
If I add this filter under existing BusinessPartnerRoleKey1, all address books for all users are filtered then.

So I tried to create my own BusinessPartnerRole_AF_Filtered relationship to filter by it.

But if I add it into datastructure, I get the same result - all forms for all users are filtered again.

Is it possible to say some way, that the filter is valid only for something/somebody?
Or have I to create another data structure?

First of all you do not need to create a filtered relationship. It would probably only confuse you in the future and you duplicate a functionality (the relationship between BusinessPartner and BusinessPartnerRole entities is already modelled in the existing relationship).

So instead just use the existing relationship and set the filter in a filter set. If the data structure is used also for other filters, set up the IgnoreCondition so the “filter” entity is only joined when actually used by a filter in a filter-set. For other filter-sets this entity will be ignored.

Now when you already have the FilterParent setting, you should definitely get only records in BusinessPartner filtered by the child values. Your example looks well and it should actually filter records well.

1 Like

So simple it is. Thank you.