std.DeleteObject

This job identifies an object (document, register, folder) via the specified parameters and deletes it — either into the recycle bin (reversible) or permanently (not recoverable). The job is the central deletion path for DMS objects.

The parameters dwParentID and dwParentType are only considered for documents. If a document has multiple entries in the sdrel table (multi-location storage) and both dwParentID = 0 and dwParentType = 0, all locations are removed; with a parent set, only that one location is removed.

1. Input Parameters

Name Type Required Description

sDeleteMethod

STRING

Yes

Deletion method:
Delete = object is permanently deleted (without recycle bin), or objects already in the recycle bin are removed permanently
DeleteWithDocs = valid for cabinet/register; all contained registers/documents are deleted along with it
Recycle = object is moved to the recycle bin (reversible through the restore function)

dwObjectID

INT

Yes

ID of the object

dwObjectType

INT

Yes

Type of the object to be deleted

dwParentID

INT

Yes

ID of the parent object. 0 if the object is directly in the root archive, or if all storage locations of a multi-location document are to be affected.

dwParentType

INT

Yes

Type of the parent object. 0 if dwParentID = 0.

[sSpecific]

STRING

No

Children = subobjects are deleted; otherwise empty.

[$SwitchContextUserName$]

STRING

No

Generic enaio® mechanism to switch the effective user context for the operation. The supplied user name is used for the permission check and the history entry, even when the connection runs under a technical service user.

2. Output Parameters

Name Type Dependency Description

[sInfo]

STRING

Optional

Only returned if a register/cabinet to be deleted contains subobjects.

[Clause]

INT

Optional

Always 1.

3. Return Value

(INT): 0 = job successful, otherwise error code (e.g. object does not exist, missing delete permission, foreign-key constraint, object is locked).

4. Notes

  • Recoverable with Recycle — an object in the recycle bin can be brought back through the restore function as long as it has not been permanently deleted (Delete).

  • History entry — every deletion creates an audit entry in osobjhist; the osuser value there corresponds to the user switched in via $SwitchContextUserName$ (otherwise the connection user). The history entry survives the permanent deletion of the object.

  • Asynchronous index cleanup — after a successful deletion, a message is enqueued into the FULLTEXTDELETE queue (oscpmqueue) so the full-text indexer removes the index entry. Right after this job returns, the object may therefore still appear briefly in the full-text index until the indexer has processed the message — see Capture and Processing Messages (CP).

  • Multi-location storageRecycle with a non-zero dwParentID/dwParentType removes only that addressed location; with dwParentID = 0, all storage locations of the object are removed.

  • std.RestoreObject — restores an object previously deleted via Recycle from the recycle bin

  • std.DeleteDocument — specific variant for plain document objects; std.DeleteObject is the generic path for arbitrary object types

  • std.DeleteDocumentVersion — deletes a single document version rather than the whole object

  • dms.XMLDelete — XML-based delete variant through the generic XML interface of the DMS engine

  • std.CreateCPMessages — produces CP messages (analogous to this job’s implicit FULLTEXTDELETE enqueue)