Defining Custom Views in an AL Page Extension
Short answer
BD Declare the new filtered view in the views section of the page extension and set SharedLayout = false so it can display only the required custom Customer fields.
Question
The extension must provide the following implementation:
• The page view must show only customers with Balance Due (LCY) > 1000 and with CountryRegion Code = US
• The view must display only some custom fields from the Customer table
You need to define the page view and the required filter.
Which two actions should you perform? Each correct answer presents part of the solution. (Choose two.)
NOTE: Each correct selection is worth one point.
Key Takeaways
The question tests where page views live in a page extension and how the SharedLayout property controls whether a view can present its own set of fields — the trap is assuming SharedLayout = true or placing the view inside layout or actions.
In an AL page extension for the Customer List page, a filtered, field-reduced customer view must be declared in the views section, using a where clause for Balance Due (LCY) > 1000 and CountryRegion Code = US. Because the view shows only some custom fields, it must own its field layout, which requires SharedLayout = false.
Common mistake: The most common wrong pick is option E (SharedLayout = true), because learners associate 'shared' with reusing the page. SharedLayout = true forces the view to reuse the extension's existing layout, so it cannot display only a subset of custom fields; placing the view in the layout or actions section (A or C) is also syntactically wrong.
Expert Analysis
Why the Answer Is Correct
In AL, a page extension exposes a dedicated views section where you declare named views such as view(USHighBalance) with a where filter, for example where("Balance (LCY)" > 1000, "Country/Region Code" = 'US'). Setting SharedLayout = false detaches the view from the page's shared field layout so you can add, modify, or hide only the custom Customer table fields the requirement calls for, which is exactly what option D plus option B deliver together.
Why the Other Options Are Wrong
Views are neither placed in the layout section nor in the actions section — layout holds the field/pagepart container definitions and actions holds action items, so options A and C are invalid AL structure for a view. Option E, SharedLayout = true, is the default behavior that makes the view reuse the existing layout; that directly conflicts with the requirement to show only some custom fields, since you cannot remove fields from a shared layout on a per-view basis.
Community Comment Notes
A learner voted B and D and justified it by noting that "The view must display only some custom fields from the Customer table" means the view needs its own layout, so "SharedLayout = True will not satisfy the requirement." That reasoning supports dropping option E and confirms the SharedLayout = false choice; no comment defended placing views in the layout or actions sections.
Exam Strategy
When a requirement says a view must show a different set of fields, always pair a views-section declaration with SharedLayout = false, plus a where clause for the filters. If the requirement were only filtering while keeping the same fields, the default shared layout would be enough — read carefully which one is asked.
Frequently Asked Questions
Why can't I use SharedLayout = true for this Customer List view?
Where is the where filter placed for a view in a page extension?
Discussion 1 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 1
-
SpotSquare 👍 1The keywords "The view must display only some custom fields from the Customer table" means that it needs a view of its own. So SharedLayout = True will not satisfy the requirement
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.