HASFILTER Function (Record)
Determines whether a filter is attached to a record within the current filter group.
Ok := Record.HASFILTER
The record within the current filter group to check for a filter.
Property Value/Return Value
true if there is a filter; otherwise, false.
The following example uses the HASFILTER function to determine whether the Customer table that contains the MyRecord record has a filter. The function returns No because the MyRecord record has no filters. The return value is displayed in a message box. The SETFILTER Function (Record) is then used to set a filter for the table. This time, the return value is Yes because the table now has a filter. This example requires that you create the following variables in the C/AL Globals window.
HasFilter := MyRecord.HASFILTER; MESSAGE('Does this record have a filter? %1', HasFilter); MyRecord.SETFILTER("No.", '100..200'); HasFilter := MyRecord.HASFILTER; MESSAGE('Does this record have a filter? %1', HasFilter);