This topic contains 2 replies, has 3 voices, and was last updated by Hiro 9 years, 6 months ago.
- Topic
I need to add Datagrid filter to enable to list Entities having the filter value in ManyToMany field.
What I have tried:
1234567891011121314151617181920212223242526272829303132333435datagrid:acme-grid:extended_entity_name: %acme.entity.class%options:entityHint: acmeexport: truesource:type: ormacl_resource: acme_viewquery:select:- a.id# b.code is like tags for Blog Item# So the associated record(s) in Entity "b" may exist- b.code as ItemCodefrom:- { table: %acme.entity.class%, alias: a }join:left:# This does not return the Entity "a" having zero associated records in Entity "b"- { join: a.item, alias: b }(Omitting)filters:columns:id:type: stringdata_name: a.id# I need to provide this filter which let you filter by the value in the child EntityItemCode:type: stringenabled: falselabel: acme.item_code.labeldata_name: ItemCodeAs the comment says, I don’t seem to be able to expect DQL to return the parent table data even if the child data does not exist by using LEFT JOIN (Maybe because the child table gets multiple records?).
Is there a workaround for this situation, like, is there a way to apply subquery using EXISTS only if the filter “ItemCode” is used somehow? If not, is there any timing we can amend the DQL right before the query execution to chuck in the subquery after checking if the filter is ItemCode by creating custom Listener Class or something?
The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.