set_history()
Adds a custom history entry to an object via std.SetHistory. The server
creates an entry of type OBJECT_INFORMATION (action ID 31) in the object’s
history table. This works for all object types (folders, registers, documents).
1. Signature
-
Sync
-
Async
ecm.dms.set_history(
model: _ECMModelBase | int,
info: str,
object_type_id: int | None = None,
) -> None
await ecm.dms.set_history(
model: _ECMModelBase | int,
info: str,
object_type_id: int | None = None,
) -> None
2. Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
— |
Either an ECM model instance (its |
|
|
— |
The information text to store in the history entry. |
|
|
|
The numeric object type ID. If |
4. Exceptions
| Exception | Condition |
|---|---|
|
|
|
|
5. Examples
5.1. Add a history entry to a document
-
Sync
-
Async
doc = ecm.dms.get(InvoiceDocument, 12345)
ecm.dms.set_history(doc, "Processed by automated workflow")
doc = await ecm.dms.get(InvoiceDocument, 12345)
await ecm.dms.set_history(doc, "Processed by automated workflow")
5.2. Add a history entry by plain ID
-
Sync
-
Async
ecm.dms.set_history(12345, "Export completed", object_type_id=327685)
await ecm.dms.set_history(12345, "Export completed", object_type_id=327685)
5.3. Add history entries to all query results
-
Sync
-
Async
for folder in ecm.dms.select(InvoiceFolder).where(InvoiceFolder.Year == 2024).stream():
ecm.dms.set_history(folder, "Marked for annual review")
async for folder in ecm.dms.select(InvoiceFolder).where(InvoiceFolder.Year == 2024).stream():
await ecm.dms.set_history(folder, "Marked for annual review")
6. See also
-
history() — Read the modification history of an object