This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
entity.first( )
|
entity.first () -> Result | ||||||||
Parameter | Type | Description | ||||||
Result | Entity, Null |
![]() |
Reference to first entity of an entity selection | |||||
The entity.first( ) method returns a reference to the entity in first position of an entity selection.
If the entity does not belong to any existing entity selection (i.e. entity.getSelection( ) returns Null), the method returns a Null value.
C_OBJECT($employees;$employee;$firstEmployee)
$employees:=ds.Employee.query("lastName = :1";"H@") //This entity selection contains 3 entities
$employee:=$employees[2]
$firstEmployee:=$employee.first() //$firstEmployee is the first entity of the $employees entity selection
entity.last( )
entity.next( )
entity.previous( )
entitySelection.first( )
Product: 4D
Theme: ORDA - Entity
Created: 4D v17
4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)