Dear All,
I have a header entity BillingCycles with a detail entity called BillingAdjustments. The later is defined as an ASSOCIATION field on the BillingCycles entity.
On the detail level, I am implementing a “posting” functionality which posts the billing adjustment detail line by changing its posted field to true.
Once this is done, I need to remove it from the detail view. In other terms, the detail datasource should only show lines pertaining to the header billing cycle but with posted = false.
I cannot set this on the nested datasource level since there is no query window at this level.
I tried to write it on the xml file of the screen but this is not taking any effect.
<collectionDatasource id="billingAdjustmentsDs"
property="billingAdjustments"/>
<query>
<![CDATA[select e from billing$BillingAdjustments e
where e.posted = false]]>
</query>
</collectionDatasource>
I tried to set the filter on the init() method, but this resulted in an UnsupportedOperationException:
java.lang.UnsupportedOperationException
at com.haulmont.cuba.gui.data.impl.CollectionPropertyDatasourceImpl.refresh(CollectionPropertyDatasourceImpl.java:691)
at com.company.billing.web.billings.PendingbillingsBrowse.lambda$init$0(PendingbillingsBrowse.java:80)
at com.haulmont.bali.events.EventRouter.fireEvent(EventRouter.java:45)
at com.haulmont.cuba.web.gui.components.WebLookupField.lambda$attachListener$4850968e$1(WebLookupField.java:203)
at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Map<String, Object> adjustmentParams = new HashMap<String, Object>();
adjustmentParams.put("posted", false);
billingAdjustmentsDs.refresh(adjustmentParams);
What is the solution to fulfill this simple requirement?
Appreciate your prompt feedback.
Regards,
Shady