Skip to main content

Notifications

Small and medium business | Business Central, N...
Unanswered

Defaults a filter View on a List Page

Posted on by 2
Hello,
 
I have a List page and it has a field named /Open/. Also, I have Open and Closed views written in code for the page to filter on the field /Open/, so that the user can click on each view to filter the records. I can see three views on the page /All/, /Open/, and /Closed/. 
 
I have a Role center Cue to view only the opened records. When I click on this cue, it always filters only the open records as expected, but it defaults to /All/ view on the page. Is there a way to get my custom filter to be the default one, which means it defaults to the Open when I click on the Cue in Role Center?
 
 
 
Thanks, in advance.
 
Shibily
Categories:
  • Defaults a filter View on a List Page
    Just to be clearer, I have written code to add views in filter pane of the page. please see below.
    views
    {
    view(OnlyOpen)
    {
    Caption = 'Open';
    Filters = where(Open = CONST(true)).
    }
    view(OnlyClosed)
    {
    Caption = 'Closed';
    Filters = where(Open = CONST(false));
    }
    }


    These additional filter views will help the user to toggle between the open and closed records.
    On top of these two custom Open and Closed Views, there is another system generated view called "All", and it shows all records.

    So, I have a Role center Cue, where I wanted to show only open records. When the user clicks on it, the page will filter only open records (based on the filter set in cue table), but as it is showing only open records, I wanted the "Open" View gets selected in that case. unfortunately, it is selecting the "All" view by default in this case. Please see the screenshot below where I have 3 views in the filter pane. So, what I was expecting is to select the "Open" View when I click on Cue from Role center which is supposed to show only open records, like in the screenshot below.
     
    nr7kkpzdcdcb.png
     
  • YUN ZHU Profile Picture
    YUN ZHU 73,339 Super User 2024 Season 2 on at
    Defaults a filter View on a List Page
    Hi, you can add a default filter in the OnOpenPage() trigger of the standard page. The following is a simple example. If you allow users to remove the filter, you can delete the FilterGroup related code.
     
    Hope this helps.
    Thanks.
    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,228 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,056 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans