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.
- If you pass entity as parameter, you compare this entity with the entity selection. If the entity belongs to the entity selection, a new reference to the entity selection is returned. Otherwise, a new entity selection containing the original entity selection and the entity is returned.
- If you pass entitySelection as parameter, you compare entity selections. A new entity selection containing the entities belonging to the original entity selection or entitySelection is returned (or is not exclusive, entities referenced in both selections are not duplicated in the resulting selection).
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.