Defining View Data

The Data tab allows you to fetch entity data that will be displayed on the view, select the view columns and define the default sort of the view records.

NOTE  You have to save the view before fetching entity data.

To define what data is shown in the view and the sorting order of records, follow these steps:

STEP 1. Fetch entity data

Fetching data allows you to filter entity records displayed in view based on specific criteria (e.g business status, security role).

There are two ways in which you can fetch entity data:

IMPORTANT!  
The Fetch Designer is a visual tool that allows you to populate the Fetch Object Expression field without having to code. When you define a fetch in the Fetch Designer, any existing content in the Fetch Object Expression field will be overwritten.

STEP 2. Define the View Columns

You have two options to define the view header (that is, the columns to be displayed on the view):

  • In the Data field, list the name of the fields which will define the columns displayed by the view.

    Make sure that you list the name of the fields separated by comma.

  • In the Entity View Columns section, insert the desired view columns.
NOTE  The view columns added in the Entity View Columns section have a higher priority than the ones mentioned in the Data field. If both entity view columns and data columns are defined, the entity view will display only the columns added in the Entity View Columns section.

To define the view columns from the Entity View columns, click the Insert button at the top of the section. The Add Entity View Column page will be displayed. Provide the following view column details:

Property

Description

Entity View

The field is automatically filled in with the name of the selected view.

Width

The column width. Enter a numeric value.

Cell Template

A custom HTML element which defines the cell layout on the entity view column. In this field you can add text, HTML or tokens.

A token can be any attribute returned by the fetch expression. Attributes are referenced as tokens by their name prefixed by the alias of the fetch inside curly brackets (e.g., {base.Name}).

Cell template example:

Copy
<div onclick="window.location.hash ='/entity/MKT_Activity/edit/{a.MKT_Activityid}'
" style="cursor: pointer; color: white; display: inline; float: left;
 border: 2px solid rgba(0, 0, 0, 0); background: #27a8e1; text-align: center;
 margin: 2px; padding: 2px;">POP</div>

For more information on how to use cell templates for views, see Create Views using Cell Template.

Width Is Percentage

If selected, it indicates  that the value provided in the Width field is percentage.

Attribute Name

The name of the attribute whose values will be displayed in the column.

You can overwrite the attribute when providing a cell template.

Label

The column name that will be displayed on the entity view in the user interface.

Allow Editing

If selected, the column view can be edited.

At the upper-right corner of the page, click the Save and close icon. Add as many view columns as you need. They will be listed in the Entity View Columns section.

The view columns are displayed from left to right in the order of their index (OrderIdx). The first column has the OrderIdx set to 1.

To change the order in which the columns are displayed on the view, in the Entity View Columns list drag and drop rows.

You can also auto-populate the view columns. For more information, see Generate View Columns..

STEP 3. Set the default sorting of the view records

By default the view records are sorted ascending by the entity primary attribute.

To change the default view records sorting, in the Sort Expression field, enter the attribute name by which the records will be sorted, followed by an asterisk (*) symbol and the sorting direction: asc for ascendant and desc for descendant.

The figure below shows how a view looks like in the user interface.