How to List page Filtration in Dynamics 365 F&O 

    List Page Filtration in Dynamics 365 F&O is used to display a collection of records from a primary table in a grid format. These pages are mainly used for viewing, searching, and managing large sets of data. 

    Filtering records in a List Page is important when we want to restrict the displayed data based on specific conditions such as user roles, groups,  statuses, or business logic. 

      Unlike normal forms, List Pages use a query-based architecture. 

      Components Involved 

      • Form  
      • Query  
      • Data Sources  
      • Grid Controls  

      The query defines how data is fetched from the database. 

        Although executeQuery() is commonly used in normal forms, it is not recommended for List Pages. 

        Reasons 

        • List pages rely on queries  
        • The query is prepared before the form loads  
        • Modifying the query in executeQuery() can cause performance and filtering issues  
        • Standard Microsoft practice is to modify the query in initializeQuery() 
        1. How to Identify: The form is a list page. 

        You can identify a List Page based on its form design

        List Page Filtration in Dynamics 365 F&O

        Example: List Page Filtration 

        When the Production Order List Page is opened from a custom form (e.g., Project Master), the system should: 

        Display only the production orders that belong to the selected Project ID 

        Note: Search in AOT for the Interaction class related to the List Page and use that class for creating the extension.(eg: ProdTableListPageInteraction) 

        [ExtensionOf(classStr(ProdTableListPageInteraction))] 
        final class SYN_ProdTableListPage_Extension 

            public void initializeQuery(Query _query) 
            { 
                next initializeQuery(_query); 
                // Check if the list page was opened using the SCC_ProdTableListPage menu item 
                if (this.listPage().listPageArgs().menuItemName() ==  menuItemDisplayStr(SCC_ProdTableListPage)) 
                { 
                    ProjId _projId = this.listPage().listPageArgs().parameters(); 
                    QueryBuildDataSource qbds = _query.dataSourceTable(tableNum(ProdTable)); 
                    qbds.addRange(fieldNum(ProdTable, SCC_ProjectId)) 
                        .value(queryValue(_projId)); 
                } 
            } 
        • When the list page is opened from the Project Master form  
        • Only production orders related to the selected Project ID are displayed