| 4D v18entitySelection.{attributeName} | |||||||||||||||||||||||||||||||||||||||||||||||
| 
 | 
    4D v18
 entitySelection.{attributeName} 
         | ||||||||||||||||||||||||||||||||||||||||||||||
| Parameter | Type | Description | ||||||
| entitySelection.{attributeName} | Collection, EntitySelection |   | Projection of attribute values for the entity selection | |||||
Any dataclass attribute can be used as a property of an entity selection to return a "projection" of values for the attribute in the entity selection. Projected values can be a collection or a new entity selection, depending on the kind (storage or relation) of the attribute.
When a relation attribute is used as a property of an entity selection, the result is always another entity selection, even if only one entity is returned. In this case, if no entities are returned, the result is an empty entity selection.
Note: For more information on attribute kind, please refer to the dataClassAttribute.kind property description.
If the attribute does not exist in the entity selection, an error is returned.
Projection of storage values:
 C_COLLECTION(firstNames)
 $entitySelection:=ds.Employee.all()
 firstNames:=$entitySelection.firstName // firstName type is stringThe resulting collection is a collection of strings, for example:
[ "Joanna", "Alexandra", "Rick" ]
Projection of related entity:
 C_OBJECT($es;$entitySelection)
 $entitySelection:=ds.Employee.all()
 $es:=$entitySelection.employer // employer is related to a Company dataClassThe resulting object is an entity selection of Company with duplications removed (if any).
Projection of related entities:
 C_OBJECT($es)
 $es:=ds.Employee.all().directReports // directReports is related to Employee dataclassThe resulting object is an entity selection of Employee with duplications removed (if any).
	Product:  4D
	Theme:  ORDA - EntitySelection
	
        
        
	
	Created:  4D v17
	
	
	
	
	
	
	
	
	4D Language Reference ( 4D v18)
	
	
	
 Add a comment
Add a comment