OCLOperators existing
Created by Peter on 2019-11-18 · Last edited by Vale.buyondo on 2025-12-13.
The existing operator returns true if any element in a collection exists (is not deleted).It is commonly used to verify whether a reference or collection still points to at least one valid (non-deleted) object.
existing is especially useful when working with optional roles or objects that may have been deleted during the current transaction
Syntax
collection->existing
How it differs from exists
exists(condition) Checks if any element satisfies a condition
existing Checks if any element still exists (not deleted)
Example
Check if a Customer has any Orders
self.Orders->existing
Returns true if at least one Order exists.
