@SetViewInfo (Formula Language)

In Standard Outline views, filters a view to display only documents from a specified category. In Calendar views, filters a view to display only documents that contain a specified string in a specified column.

Note: This @function is new with Release 6.

Syntax

@SetViewInfo( [SETVIEWFILTER] ; filterString ; columnName ; isCategory [; exactMatch ] )

Parameters

[SETVIEWFILTER]

Keyword. Required. Indicates you want to qualify the documents that display in a view.

filterString

Text. Serves as the key to determine which documents display in a view. If this string is present in the column specified in columnName, includes the document in the view.

columnName

Text. The programmatic name of a column. The column specified here must contain the filterString for the document to display in the view.

Note: To clear the view filter, specify "" for filterString.

isCategory

Number. Boolean value. Required in a Standard Outline view; not for use in Calendar views. 1 indicates that the column in the columnName value is a category. 0 indicates that it is not. Set to 0 if using the exactMatch parameter for a Calendar view.

exactMatch

Number. Boolean value. Optional in a Calendar view; not for use in Standard Outline views. 1 indicates that the string in the columnName column must exactly match the string specified in filterString. 0 indicates that the filterString does not have to match exactly. For instance, if the filterString is "A," and exactMatch is set to 0, documents with "A" and "A plus" in the column specified in columnName will both be included in the view.

Usage

This @function is useful if you want to filter the documents in a view to display only a subgroup that contains specific data.

Examples

  1. This formula, when added to a hotspot button in a form, opens the Customers Standard Outline view, which is categorized by companyName. The view contains documents for people from several companies, but filters the view to display only those documents for individuals who work at the Acme Corp.
    @Command([OpenView];"Customers");
    @SetViewInfo([SETVIEWFILTER];"Acme Corp.";"companyName";1)
  2. This code, when added to a Sort action button in a Standard Outline view, filters the contents of the current view to display only those documents that have empolyeeName fields that contain the current user's name. The view is categorized by employeeName.
    @SetViewInfo([SETVIEWFILTER];@Name([CN];@UserName);"employeeName";1)
  3. This code, used in the View by Room action button in the Reservations template (resrc60.ntf), updates the Calendar view to display only calendar entries that specify as their resourceName value the resource chosen by the user from a pick list. $20 is the programmatic name of the Resource column, whose value is determined by the resourceName field.
    choice:=@PickList([CUSTOM] : [SINGLE]; @DbName; "Resources";"View by Room or Resource";"Select the room or resource whose calendar you want to see:"; 1);
    @SetViewInfo([SETVIEWFILTER];choice;"$20";0)
  4. This code, in an agent run from your Calendar view, will show only your Meetings.
    @SetViewInfo([SETVIEWFILTER];"3";"$152";0;1)