checkout()

Checks out a document via DMS.CheckOutDocument. Locks the document for the current user so that no other user can modify it until it is checked back in or the checkout is undone.

1. Signature

  • Sync

  • Async

ecm.dms.checkout(
    model: ECMDocumentModel | int,
    object_type_id: int | None = None,
) -> None
await ecm.dms.checkout(
    model: ECMDocumentModel | int,
    object_type_id: int | None = None,
) -> None

2. Parameters

Parameter Type Default Description

model

ECMDocumentModel | int

 — 

Either an ECMDocumentModel instance (its id is used) or a plain integer document object ID.

object_type_id

int | None

None

The numeric object type ID. If None, the type is extracted from the model instance when available, or resolved via get_object_type_by_id() for plain integer IDs.

3. Return value

None.

4. Exceptions

Exception Condition

ValueError

model is an ECMDocumentModel instance with id set to None.

ECMNotFoundException

object_type_id is None and no object with the given ID exists on the server.

ECMWrongStateException

The document has no pages or is already checked out.

5. Examples

5.1. Check out a document from a query result

  • Sync

  • Async

doc = ecm.dms.select(InvoiceDocument).where(InvoiceDocument.Title == "Invoice").execute()[0]
ecm.dms.checkout(doc)
doc = (await ecm.dms.select(InvoiceDocument).where(InvoiceDocument.Title == "Invoice").execute())[0]
await ecm.dms.checkout(doc)

5.2. Check out by plain ID with known type

  • Sync

  • Async

ecm.dms.checkout(12345, object_type_id=327685)
await ecm.dms.checkout(12345, object_type_id=327685)

6. See also