Filter Group

ShivasaiShivasai Member Posts: 17
What is Filter Group In Navision what is the use of this filter group where should I use this one can you tell me one scenario and give proper example when i will use filter group in which one is will be reflected in frontend

Answers

  • TallyHoTallyHo Member Posts: 417
    rtfm
  • albertassaad@hotmail.comalbertassaad@hotmail.com Member Posts: 13
    edited 08:32
    From the Help:
    A filtergroup can contain a filter for a RecordRef that has been set earlier with SETFILTER or SETRANGE. The total filter applied is the combination of all the filters set in all the filtergroups.

    This function works the same way as the FILTERGROUP Function (Record).

    The following example determines the filtergroup that is set on the Customer table and then changes filtergroup to 1, which is the filtergroup that is applied globally to the entire application. The code starts by opening the Customer table with a RecordRef variable. The SETRECFILTER Function (RecordRef) sets the values in the current key of the current record as a record filter. This filter is a standard filtergroup so it has a filtergroup number of 0. Then the FILTERGROUP function returns the number for the filtergroup. This filtergroup is a standard filter so the return value is 0. This value is stored in the varOrigGroup variable and displayed in a message box. The FILTERGROUP function changes the filtergroup to 1, which is the number for the global filtergroup. The new value is stored in the varCurrGroup variable and displayed in a message box. This example requires that you create the following variables and text constants in the C/AL Globals window:
    Variable name DataType
    MyRecordRef:RecordRef
    varOrigGroup:Integer
    varCurrGroup:Integer
    Text000:The original filtergroup is: %1
    Text001:The current filtergroup is: %1
    Code:
    MyRecordRef.OPEN(DATABASE::Customer);
    MyRecordRef.SETRECFILTER;
    varOrigGroup := MyRecordRef.FILTERGROUP;
    MESSAGE(Text000, varOrigGroup);
    varCurrGroup := MyRecordRef.FILTERGROUP(1);
    MESSAGE(Text001, varCurrGroup);


    FILTERGROUP Function (Record)
    A filter group can contain a filter for a Record that has been set earlier with the SETFILTER Function (Record) or the SETRANGE Function (Record). The total filter applied is the combination of all the filters set in all the filtergroups.

    When you select a filter group, subsequent filter settings by the SETFILTER Function (Record) or the SETRANGE Function (Record) apply to that group.

    All groups are active at all times. The only way to disable a group is to remove the filters set in that group.

    Filters in different groups are all effective simultaneously. For example, if in one group, a filter is set on customer numbers 1000 to 2000, while in another group, a filter is set on customer numbers 1800 to 3000, then only numbers in the range 1800 to 2000 are visible.

    Microsoft Dynamics NAV uses the following filter groups internally

    -1 Cross-column Used to support the cross-column search.

    0 Std The default group where filters are placed when no other group has been selected explicitly. This group is used for filters that can be set from the filter dialogs by the end user.

    1 Global Used for filters that apply globally to the entire application.

    2 Form Used for the filtering actions that result from the following:
    SETTABLEVIEW Function (Page, Report, XMLport)
    SourceTableView Property
    DataItemTableView Property.

    3 Exec Used for the filtering actions that result from the following:
    SubPageView Property
    RunPageView Property

    4 Link Used for the filtering actions that result from the following:
    DataItemLink Property (Reports)
    SubPageLink Property

    5 Temp Not currently used.

    6 Security Used for applying security filters for user permissions.

    7 Factboxes Used for clearing the state of factboxes.

    Example:
    MyRecord.SETFILTER("No.", '10000..20000');
    varOrigGroup := MyRecord.FILTERGROUP;
    MESSAGE(Text000, varOrigGroup);
    varCurrGroup := MyRecord.FILTERGROUP(1);
    MESSAGE(Text001, varCurrGroup);

Sign In or Register to comment.