M-Files API 23.11.13135.0
DestroyObject Method
VaultObjectOperations Object : DestroyObject Method
The ID of the object to destroy.
Specifies whether all versions of the object are to be destroyed. If set to "false", only the version defined in the ObjectVersion parameter is destroyed.
If "DestroyAllVersions" is false, specifies which version of the object to destroy.
Description
Destroys an object or a specific version of the object. Prefer DestroyObjectEx as its parameter ObjectVersion supports unmanaged external repository objects.
Syntax
Visual Basic
Public Sub DestroyObject( _
   ByVal ObjID As ObjID, _
   ByVal DestroyAllVersions As Boolean, _
   ByVal ObjectVersion As Long _
) 
Parameters
ObjID
The ID of the object to destroy.
DestroyAllVersions
Specifies whether all versions of the object are to be destroyed. If set to "false", only the version defined in the ObjectVersion parameter is destroyed.
ObjectVersion
If "DestroyAllVersions" is false, specifies which version of the object to destroy.
Remarks

If you want to destroy the object altogether, in other words set the DestroyAllVersions parameter to "true", the ObjectVersion parameter must be set to "-1".

If DestroyAllVersions is set to "false", ObjectVersion must point to a valid version.

See Also

VaultObjectOperations Object  | VaultObjectOperations Members