Retrieve with filter on associations

1
As a general optimization rule for retrieves I always limit the number of results instead of a condition in the loop. The model is contactperson - contactperson-customer - customer both with an association to settings. (contactperson-settings and customer-settings) In this case I wanted to find contactpersons with another setting than the customer they belong to XPath Object contactperson [module.contactperson_customer = $Customer] [module.contactperson_settings != $Customer/module.customer_settings] This does n't filter enough, I tried with id's, also the way around but no clue.
asked
3 answers
0

Your XPath should read:

[Module.ContactPerson_Customer = $Customer]

[not (Module.ContactPerson_ Settings = $Customer/Module.Customer_Settings)]

answered
0

Or you could go with

 XPath Object contactperson
[module.contactperson_customer = $Customer
 and module.contactpersonen_settings/module.settings/module.customer_settings != $customer]
answered
0

Thanks for the answers but both fail in my case. I added

or not (module.contactpersonen_settings/module.settings)

to Pieter's solution in the case no settings exist. But this gives to much 'false' returns.

answered