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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

Page Predefined Views

(1) ShareShare
ReportReport
Posted on by 2
Hello Community,
 
I have page created in code with 2 predefined views. that provide filtering as well as moving around fields see below.
 
What is the correct way to open the page from code with one of those predefined views as the active view?
 
Thanks so much
 
MJH
 
 views
    {
        view(NewDonations)
        {
            Filters = where(Gross = filter(>= 0), MatchedToDoc = filter(= ''));
            SharedLayout = false;
            layout
            {
                moveafter(name; email)
                moveafter(email; MatchedToCust)
                moveafter(MatchedToCust; MatchedToItem)
                moveafter(MatchedToItem; MatchedToClass)
                moveafter(MatchedToClass; Subject)
                moveafter(Subject; Note)
                moveafter(MatchedToCust; lookupname)
            }
        }
        view(NewExpenses)
        {
            Filters = where(Gross = filter(< 0), MatchedToDoc = filter(= ''), type = filter(<> 'T403'));
 
            SharedLayout = false;
            layout
            {
                moveafter(name; email)
                moveafter(email; MatchedToVend)
                moveafter(MatchedToVend; MatchedToPatron)
                moveafter(MatchedToPatron; MatchedToGLAccount)
                moveafter(MatchedToGLAccount; MatchedToClass)
                moveafter(MatchedToClass; Subject)
                moveafter(Subject; Note)
                moveafter(MatchedToVend; lookupname)
            }
        }
    }
I have the same question (0)
  • Gerardo Rentería García Profile Picture
    27,550 Most Valuable Professional on at
    Hi
    As the documentation indicates,
    The defined view or views are available to the user through Filter Pane on a page and appear in the sequence that they're defined in code.
    So if you want to have a default view, in the open event of the page you could apply the desired filter.
    Best Regards
    Gerardo
  • Suggested answer
    MH-06060002-0 Profile Picture
    115 on at
    Thank you for the response. I have been unable to locate a way to open a page referencing the predefined view.
     
    A bit of a hack to get it to work is the following
     
    1) When you manually select the predefined view the URL appends a query string which contains the following:   &view=162d53bc-9ab9-477e-a2b4-680605c_NewDonations
    2) In my scenario i utilized the below code
    3) The only drawback is it opens in a new tab
    4) You can utilize the following idea to make it open in the current window Thank You YZHUMS!   https://yzhums.com/29051/
     
    I hope am overlooking something more simple
     
     
    st := system.GetUrl(ClientType::Current, '', ObjectType::Page, 50103);
    st := st + '&view=162d53bc-9ab9-477e-a2b4-68063e05c_NewDonations';
    System.Hyperlink(st);

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 580 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 462 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 272 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans