company logo

PropertyHandle :: CanDelete - Can selected instance be deleted

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 deleting the instance is possible and false otherwise.

When a collection is not an owning or depending collection, instances will be, usually, removed from collection only without being deleted. In this case. In this case, canRemove() should be called, instead.

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

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

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

Implementation details