Introduction
RecordSet Variables are variables that store lists of records. Recordsets can
be used for the mass modification of records, printing records, modifying
relational fields, etc.
How to create a RecordSet?
By Query
The variable will have records selected from the database by the specified query.
Parameters:
- Query - the query that will select database
records for writing to the variable.
By Relational Field
The variable will have records stored in the many-to-many relational field or
simple relation field of the current record. For example, if we have the Book type record, and it has the
Authors relational field, we can create a recordset variable, to which
we will place authors from the Authors field and then print them.
Parameters:
- Relational Field - the relational field the records are to be taken from;
- Records - which records are to be selected: Selected - selected only, All records - all records in the field;
- Filter For Records - specifies additional rules for filtering
records.
By Filtering Recordset
In this case, the records variable will be created by applying a filter to an
existing recordset.
For example, we can create a recordset based on records selected By Folder Input
and then remove some records from it.
Parameters:
- Source Recordset - variable with the source recordset;
- Filter For Records - rules for filtering records.
By Recordset Input
The user will be offered to choose one or several records from the existing recordset.
For example, a recordset can be created by means of Query, and the user can be offered to choose one record from the query results.
Parameters:
- Source Recordset - variable with the source recordset;
- Window Title Text - the window title text for the record selection window;
- Number of Records - the number of records possible to be chosen in this window.
By Folder Input
The user will be offered to select necessary records from a database folder.
Parameters:
- Folder - folder from which records are to be selected;
- Record(s) input properties - record-entry window properties.
More...
- Number of Records - the number of records, possible to be chosen in this window.
By Standard Set
Recordset will be created based on one of the standard record sample:
Parameters:
- Record Type - record type for records in the recordset.
- Source - source of sampling:
- Auto - selected items in the current record folder. If there are none, then last query results.
- Current Record - the current record opened in the main window;
- Records in Current Folder - all the records in the current folder;
- Selected Records - selected records;
- Query Results - last query results;
- Recordset variable... - variable set from another Recordset;
- Left/Center Query Window - recordset kept at the left\center window of query results;
- Number of Records - the number of records possible to be chosen in this window.
By Boolean Operation
Recordset will be created based on the result of a boolean operation on two other recordset.
Parameters:
- Recordset A, Recordset B - source recordsets;
- Operation. Lets assume that the recordset A contains records 1, 2, 3. And the recordset B contains records 2, 3, 4.
- OR - returns combination of two recordsets into one. I.e. it returns all records from both recordsets (1, 2, 3, 4);
- AND - returns intersection of two recordset. I.e. it returns only records which is both in the recordset A and the recordset B (2, 3);
- SUB - returns substraction of the recordset B from the recordset A. I.e. it returns records from the recordset A without records
from the recordset B (1).
Other means
In order to create a relational variable, you can use forms for data entry.
To learn more...
Usage of RecordSet Variables
Further on this variable can be used for the following purposes:
Examples
Adding Records to Relational Field
A sample of a script that carries the selected records from the many-to-many Field_A to Field_B and displaying the number of carried records:
Changing Records
In this example:
- Line 1: Places set of records created with the All Records query to the [$rset]
variable.
- Lines 2, 4: Defines the cycle, in which all operations will apply to records
stored in the [$rset] variable and not to current
records.
- Line 3: Cycle body. Increase the value of the record's [Field A]
by one.
| |
|
|
All topics in the "Variables" section:
|
|