web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Defaults a filter View on a List Page

(0) ShareShare
ReportReport
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
I have the same question (0)
  • YUN ZHU Profile Picture
    95,729 Super User 2025 Season 2 on at
    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
  • Community member Profile Picture
    2 on at
    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
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,362

#2
YUN ZHU Profile Picture

YUN ZHU 867 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 607

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans