Export (0) Print
Expand All

SETTABLEVIEW Function (Dataport, Form, Report, XMLport)

Microsoft Dynamics Nav 2009

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


SETTABLEVIEW(Record)

Parameters

Record

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

SalesHeader

Record

Sales Header

SomeForm

Form

Sales List

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

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

ADD
Show:
© 2014 Microsoft