web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    25,078 Most Valuable Professional on at
    Page Predefined Views
    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
    91 on at
    Page Predefined Views
    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

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 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans