This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
entitySelection.or( )
|
entitySelection.or ( entity | entitySelection ) -> Result | ||||||||
Parameter | Type | Description | ||||||
entity | entitySelection | Entity, EntitySelection |
![]() |
Entity or entity selection to intersect with | |||||
Result | EntitySelection |
![]() |
New entity selection or new reference to the original entity selection | |||||
The entitySelection.or( ) method combines the entity selection with the entity or entitySelection parameter using the logical (not exclusive) OR operator; it returns a new, unordered entity selection that contains all the entities from the entity selection and the parameter.
Note: You can compare ordered and/or unordered entity selections. The resulting selection is always unordered. For more information, please refer to the Ordered vs Unordered entity selections paragraph in the 4D Developer Guide.
If the original entity selection and the entitySelection parameter are empty, an empty entity selection is returned. If the original entity selection is empty, a reference to entitySelection or an entity selection containing only entity is returned.
If entitySelection is empty or if entity is Null, a new reference to the original entity selection is returned.
If the original entity selection and the parameter are not related to the same dataclass, an error is raised.
C_OBJECT($employees1;$employees2;$result)
$employees1:=ds.Employee.query("lastName = :1";"H@") //Returns "Colin Hetrick","Grady Harness"
$employees2:=ds.Employee.query("firstName = :1";"C@") //Returns "Colin Hetrick", "Cath Kidston"
$result:=$employees1.or($employees2) //$result contains "Colin Hetrick", "Grady Harness","Cath Kidston"
C_OBJECT($employees;$employee;$result)
$employees:=ds.Employee.query("lastName = :1";"H@") // Returns "Colin Hetrick","Grady Harness", "Sherlock Holmes"
$employee:=ds.Employee.get(686) //the entity with primary key 686 does not belong to the $employees entity selection
//It matches the employee "Mary Smith"
$result:=$employees.or($employee) //$result contains "Colin Hetrick", "Grady Harness", "Sherlock Holmes", "Mary Smith"
Product: 4D
Theme: ORDA - EntitySelection
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)