company logo

Property :: canInsert - Can instance(s) be inserted into collection

The function checks, whether instances can be inserted or appended into a collection or not. The function returns true, when creating a new instance and adding an existing instance within the collection is possible. Otherwise, the function returns false.

The function may be called in order to check whether an existing instance can be inserted to collection (insertReference()) or not.

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

  1. The property handle is opened for read, only
  2. Instance cannot be inserted into base extent (super set.canInsert())
  3. Inverse reference exists but cannot be updated (inverse.canUpdateCollection())
  4. Maximum number of instances in the collection exceeded
  5. The current application does not have rights for inserting the instance (disabled by context)
  6. The property handle is invalid.
  7. Updating is denied by context handler (client or server) TypeContext::canInsert()
Return value:  Success ( bool  )

The value is true when the function was executed successfully. Otherwise the value is set to false.

Implementation details

bool Property  :: canInsert (  )