Modifier

Partager via


Page.SetTableView(var Record) Method

Version: Available or changed with runtime version 1.0.

Applies the table view on the current record as the table view for the page, report, or XmlPort.

Syntax

 Page.SetTableView(var Record: Record)

Parameters

Page
 Type: Page
An instance of the Page data type.

Record
 Type: Record
The record that has a table view that you want to apply to the page or data item.

Remarks

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.

This method only narrows the view of the table that was set through the SourceTableView Property of the page or through the DataItemTableView Property of the data item.

Important

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.

Example

This example is based on the Sales Header table and shows how SetTableView is used for a page object.

 var
    SalesHeader: Record "Sales Header";
    SomePage: Page "Sales List";
begin
    SalesHeader.SetCurrentKey("Document Type");  
    SalesHeader.SetRange("Document Type",SalesHeader."Document Type"::Order);  
    SomePage.SetTableView(SalesHeader); // Only view sales orders.  
    SomePage.Run;
end;

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.

Page Data Type
Get Started with AL
Developing Extensions