The AL developer preview is still evolving with frequent updates. Follow us on the Dynamics NAV Team Blog for the announcements.
HASFILTER Method (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 method to determine whether the Customer table that contains the MyRecord record has a filter. The method returns No because the MyRecord record has no filters. The return value is displayed in a message box. The SETFILTER Method (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 global variables.
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);