I think I have run into a caching problem with the object picker form control where the attribute useCache="false"
seems to be not working. So here’s my scenario:
In our app we have an object “EventArticle” that has a relation to object “ErpEvent”.
I want to use object picker to present a list of all ErpEvents that are referenced by any EventArticle.
I defined a filter in Config.cfc like this:
settings.filters.pricelists = {
filter : "EXISTS( SELECT 1 FROM pobj_eventarticle WHERE eventId = ErpEvent.id )"
}
and then I use the object picker form control like this:
<field name="pricelist" sortorder="10" control="objectPicker" object="ErpEvent" objectFilters="pricelists" required="true" useCache="no" />
The problem is that the result of the first element call is always re-delivered, even if the result set has changed in the meantime.
I played around with ObjectPicker.cfc and finally changed line 29 to
var prefetchCacheBuster = getTickCount();
and the problem was gone. To me that seems to confirm it is a caching problem.
Could it be the problem is caused by using a standard SQL clause for the filter and not a proper ORM clause? How should I go about this, please?
Thank you in advance!