
In a section in Creatio, the data displayed in the list is based on the filters selected or added by the user. However, what if you always want to filter out certain types of records. For example, what if you want data that meets some condition to never display (or always display)? In the section code, you can retrieve the filters set for the section and completely replace them, or just add some additional conditions to them. This applies if the section doesn’t have any filters set, you can still set or add your own.
The section has a function you can override called getFilters. This function retrieves all the conditions set for the section list, which can include folders with conditions as well as the quick filters at the top of the section. If we override this function, we can get the filters set for the list and then replace them or add additional filters. In this case, we’ll always filter out records that have a boolean column “UsrFlagged” set as true.
To accomplish this we’ll add the following in the section schema methods:
getFilters: function() { // get the filters set for the section from the parent function var filters = this.callParent(arguments); // now add our filter filters.add("FilterType", this.Terrasoft.createColumnFilterWithParameter( Terrasoft.ComparisonType.EQUAL, "UsrFlagged", false)); // now return the filters so they are applied to the list return filters; }
That will now be a filter *always* for the section, regardless of what the user sets or what the folder conditions are. You can make this more useful by even conditionally restricting the records in the section based on a user or role.
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!