Create entity selection
*Create entity selection ( dsTable : Table { ; settings : Object } ) : 4D.EntitySelection
Parameter | Type | Description | |
---|---|---|---|
dsTable | Table | → | Table in the 4D database whose current selection will be used to build the entity selection |
settings | Object | → | Build option: context |
Function result | 4D.EntitySelection | ← | Entity selection matching the dataclass related to the given table |
Description
The Create entity selection
command builds and returns a new, alterable entity selection related to the dataclass matching the given dsTable, according to the current selection of this table.
If the current selection is sorted, an ordered entity selection is created (the order of the current selection is kept). If the current selection is unsorted, an unordered entity selection is created.
If the dsTable is not exposed in ds
, an error is returned. This command cannot be used with a Remote datastore.
In the optional settings parameter, you can pass an object containing the following property:
Property | Type | Description |
---|---|---|
context | Text | Label for the optimization context applied to the entity selection. |
Example
var $employees : cs.EmployeeSelection
ALL RECORDS([Employee])
$employees:=Create entity selection([Employee])
// The $employees entity selection now contains a set of reference
// on all entities related to the Employee dataclass
See also
USE ENTITY SELECTIONdataClass.newSelection()
Properties
Command number | 1512 |
Thread safe | ✓ |