USE ENTITY SELECTION
USE ENTITY SELECTION ( entitySelection : 4D.EntitySelection )
Parameter | Type | Description | |
---|---|---|---|
entitySelection | 4D.EntitySelection | → | An entity selection |
Description
The USE ENTITY SELECTION
command updates the current selection of the table matching the dataclass of the entitySelection parameter, according to the content of the entity selection.
This command cannot be used with a Remote datastore.
This command is designed to make 4D current selections benefit from the power of ORDA queries. For performance reasons, in 4D single-user and 4D Server, the command directly connects entitySelection to the current selection. Therefore, once entitySelection has been used, it must not be reused or altered afterwards.
After a call to USE ENTITY SELECTION
, the first record of the updated current selection (if not empty) becomes the current record, but it is not loaded in memory. If you need to use the values of the fields in the current record, use the LOAD RECORD
command after the USE ENTITY SELECTION
command.
Example
var $entitySel : cs.EmployeeSelection
$entitySel:=ds.Employee.query("lastName = :1";"M@") //$entitySel is related to the Employee dataclass
REDUCE SELECTION([Employee];0)
USE ENTITY SELECTION($entitySel) //The current selection of the Employee table is updated