4D v16.3

Displaying and selecting records

Home

 
4D v16.3
Displaying and selecting records

Displaying and selecting records  


 

When managing data, you select the group of records with which you want to work. This group of records is called the current selection. The current selection can contain none, one, some, or all of the records in a table. Every table and every process has its own current selection of records.

The current selection is an important concept in 4D. The most common data management operations are performed on the records in the current selection. These operations include:

  • Sorting records,
  • Viewing and modifying individual records,
  • Updating a group of records,
  • Printing a report,
  • Generating labels,
  • Graphing data,
  • Exporting records.

In other words, creating a current selection in a table is the first step towards numerous other data management operations. 

The current selection of records is always the set of records most recently selected. For instance, you might have a company database that uses an Employees table to keep track of employee records. Suppose that you decide to search for the records of all engineers in the company.
When this query begins, the current selection may contain the records of all employees in the company — salespeople, production personnel, engineers, and so on. When the query is completed, the current selection contains only the engineers’ records. If you were to print a list of records, the list would contain only the records in the current selection — in this case, the records for all of the engineers in the company. If you were to graph employee salaries, your graph would display the salaries for all of the engineers in the company.

The current selection remains the same until you perform an operation that changes it. You can change the current selection by:

  • Selecting all records,
  • Manually selecting a subset of records,
  • Searching for records.

The title bar of the output form tells you how many records are in the current table and how many records from the table are in the current selection.

4D Server: In a remote 4D, only the number of records in the current selection is displayed.

The control panel of certain input forms displays, under the navigation buttons, the number of the record selected and the total number of records in the current selection. The number of the record selected corresponds to its position in the current selection.

Every table in a database has its own current selection. In a relational database, changing the current selection in one table can change the current selections in related tables. For example, in a database consisting of related [Employees] and [Departments] tables, a opening an input form in the [Departments] table changes the current selection in the [Employees] table. That is, the employees belonging to that department become the new current selection in the [Employees] table. For more information about relations, refer to Types of relations.

If you use processes for carrying out tasks in the database, there may be several simultaneous current selections per table. Each process acts like an individual 4D environment, which lets you carry out separate tasks. It can be useful to have more than one current selection, particularly when you are comparing two or more types of data, such as the monthly invoicing of several different sales regions. For more information about processes, refer to Processes in the 4D Language Reference manual.

When using an output form to display records, you can reset the current selection so that it contains all the records in the current table. 

In the Application environment, this operation could be carried out via the “Select All” standard action or the ALL RECORDS command of the 4D language.

In the Design environment, you can use the Show All command from the Records menu. All the records of the current table are then included in the current selection. 

Note: The Show All command is disabled when you are using an input form.

You can specify a new current selection in an output form by manually "marking" certain records, then defining them as the new current selection. This is referred to as creating a subset.

In the Application environment, you manage records marked by users via commands for handling Sets and commands of the  Selection theme. 

In the Design environment, there is a specific Show Subset command in the Records menu. When you select this command, 4D restricts the current selection to the records that have been selected (marked) manually in the window. 

The different ways of manually selecting records are described in the “Highlighting” section in Output forms.

 
PROPERTIES 

Product: 4D
Theme: Managing records

 
HISTORY 

 
ARTICLE USAGE

4D Design Reference ( 4D v16)
4D Design Reference ( 4D v16.1)
4D Design Reference ( 4D v16.3)