SETTABLEVIEW Function (Page, Report, XMLport)
Applies the table view on the current record as the table view for the page, report, or XMLport.
The record that has a table view that you want to apply to the page or data item.
The table view is the view of the table that you present to the user. You determine what records that the user can see by setting filters, determining the sorting order, and selecting the keys.
SETTABLEVIEW is not supported for setting views on subpages from code on table headers. For example, you cannot set a table view on the SalesOrder subpage from the SalesHeader.
This example is based on the Sales Header table and shows how SETTABLEVIEW is used for a page object. It requires that you create the following variables.
SalesHeader.SETCURRENTKEY("Document Type"); SalesHeader.SETRANGE("Document Type",SalesHeader."Document Type"::Order); SomePage.SETTABLEVIEW(SalesHeader); // Only view sales orders. SomePage.RUN
The page that is reference by the SomePage variable can be any page object that has Sales Header as the value of the SourceTable Property.