company logo

PropertyHandle :: CanRemove - Can selected instance be removed from collection

The function checks, whether an instance has been selected in the property handle and whether the selected instance can be deleted or not.The function returns true, when removing the instance from collection (without deleting it) is possible and false otherwise.

When a collection is an owning or depending collection, instances are deleted when being removed from collection. In this case, canDelete() should be called, instead, which is not automatically implied. When intending to explicitly delete an instance from a not owning collection one also should check this by callingcanDelete().

Returning true always implies canUpdateCollection(), but not necessarily reverse. There are several reasons rejecting removing the instance:

  1. The property handle is opened for read, only
  2. The current application does not have rights for removing the instance (disabled by context)
  3. The instance is an embedded part of another instance which cannot be removed
  4. The property handle is invalid.
  5. Deletion is denied by context handler (client or server) TypeContext::canRemove()
Return value:  Return value ( logical  )

The function returns YES when the question was answered positively. Otherwise it returns NO.

Implementation details