
If you have a detail in Creatio where items are added from a lookup using the LookupMultiAddMixin, by default, this adds a filter so once an item is added to the detail, it is filtered out of the lookup (preventing a user from adding it twice). However, you can also add additional filters to this as well if needed.
The LookupMultiAddMixin includes a function called getAllLookupFilters. This is the function where it applies the filter to exclude items already added. We can override this function and get the filters from the parent function, and then add additional filters to apply. Let’s say in our case, we’re adding products to a detail via a lookup. Let’s also filter out inactive products:
getAllLookupFilters: function() { var filters = this.mixins.LookupMultiAddMixin.getAllLookupFilters.apply(this, arguments); // exclude inactive products filters.add(Terrasoft.createColumnFilterWithParameter( Terrasoft.ComparisonType.NOT_EQUAL, "IsArchive", true)); return filters; }
In the code above, the first line we are calling the base getAllLookupFilters function from the LookupMultiAddMixin. Because this function is from a mixin, we can’t just call this.callParent, instead we must invoke the function from the mixin. We get the filters from that function, then add our own.
Subscribe To Our Newsletter
Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!
You have Successfully Subscribed!