active_variant()
Returns the variant flagged is_active from a document’s variant tree. Searches the whole
tree including nested levels and, like variants(), needs no
model class.
|
When the document is loaded in typed form anyway, |
1. Signature
-
Sync
-
Async
ecm.dms.active_variant(
document: int | ECMDocumentModel | ECMModelDocumentVariant,
object_type_id: int | None = None,
) -> ECMModelDocumentVariant | None
await ecm.dms.active_variant(
document: int | ECMDocumentModel | ECMModelDocumentVariant,
object_type_id: int | None = None,
) -> ECMModelDocumentVariant | None
2. Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
|
|
— |
The document: a numeric ID, a model instance, or a node from a variant tree read earlier. |
|
|
|
The numeric object type ID. If |
3. Return value
ECMModelDocumentVariant | None — the active variant, or None when the document has no
variants.
4. Exceptions
| Exception | Condition |
|---|---|
|
|
|
The server returns no object for that ID. |
5. Examples
6. See also
-
variants() — read the whole variant tree
-
set_active_variant() — switch the active variant