SETTABLEVIEW Function (Dataport, Form, Report, XMLport)

Applies the table view on the current record as the table view for the form, report, dataport, or XMLport.




Type: Record

The record whose table view you want to apply to the form 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.

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

If you use this function and the SaveTableView Property of the form is set to "Yes", then the current table view in the setup file is not saved.

This example is based on the Sales Header table and shows how SETTABLEVIEW is used for a form object. It requires that you create the following variables.

Variable name DataType Subtype



Sales Header



Sales List

SalesHeader.SETCURRENTKEY("Document Type");
SalesHeader.SETRANGE("Document Type",SalesHeader."Document Type"::Order);
SomeForm.SETTABLEVIEW(SalesHeader); // Only view sales orders.

The form that is reference by the SomeForm variable can be any form object with Sales Header as the value of the SourceTable Property.

Community Additions