4D v17.4

entitySelection.add( )

Home

 
4D v17.4
entitySelection.add( )

entitySelection.add( )  


 

The entitySelection.add( ) method adds the specified entity to the entity selection.

Note: This method modifies the original entity selection.

  • If the entity selection is ordered, entity is added at the end of the selection. If a reference to the same entity already belongs to the entity selection, it is duplicated and a new reference is added.
  • If the entity selection is unordered, entity is added anywhere in the selection, with no specific order.

Note: For more information, please refer to the Ordered vs Unordered entity selections paragraph in the 4D Developer Guide.

An error occurs if entity and the entity selection are not related to the same dataClass. If the entity to be added is Null, no error is raised.

Example  

 C_OBJECT($employees;$employee)
 $employees:=ds.Employee.query("lastName = :1";"S@")
 $employee:=ds.Employee.new()
 $employee.lastName:="Smith"
 $employee.save()
 $employees.add($employee//The $employee entity is added to the $employees entity selection



See also 

entitySelection.and( )
entitySelection.drop( )
entitySelection.minus( )

 
PROPERTIES 

Product: 4D
Theme: ORDA - EntitySelection

 
PAGE CONTENTS 
 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v17)
4D Language Reference ( 4D v17.1)
4D Language Reference ( 4D v17.2)
4D Language Reference ( 4D v17.3)
4D Language Reference ( 4D v17.4)