Default filtering on object

This allows to properly add some default filters that the user can remove

public class DemoSupplier extends ObjectDB {
	private static final long serialVersionUID = 1L;
	private static final String INIT_FILTER_FLAG="supplier_init_filter";
	
	@Override
	public void preSearch() {
		if(isMainInstance() && getGrant().getBooleanParameter(INIT_FILTER_FLAG, true)){
			getGrant().setParameter(INIT_FILTER_FLAG, false);
			setFieldFilter("demoSupCode", "BIM");	
		}	
	}
}

The filter is explicitely visible to the user, and easily removable:

1 Like