About Doctype Trigger Event Levels
Doctype trigger event levels determine if a trigger fires when data operations occur at the document version level or the document level. The majority of operations in Vault are executed against document versions, but there are some operations that are performed at the document level.
Each doctype trigger can only fire at one event level, either:
Data operations that fire doctype triggers fire either DOCUMENT_VERSION or DOCUMENT scoped triggers, not both, with one exception: The only operation that can fire both a DOCUMENT and DOCUMENT_VERSION level trigger is if the API or SDK is used to delete a specific document version, and that version is the last remaining version. This will fire both the DOCUMENT and DOCUMENT_VERSION level triggers.
Document Version Events
Section link for Document Version EventsDoctype triggers scoped to DOCUMENT_VERSION only fire on a specific version of a document, which occur any time data on a document version changes or any time a document is upversioned. In Vault, documents are versioned much like software versioning. Document versions are in the format {major_version}.{minor_version}. For example, creating a new document starts at version 0.1. There is no version 0.0. Learn more about document versioning in Vault Help
When creating a new draft version of an existing document, Vault increments the version number by 0.1. For example, if a document is version 1.0, the new draft is version 1.1. This is a document versioning event.
Some data change operations on a document which do not cause upversioning may be considered a document-level event, and do not fire triggers which are scoped to DOCUMENT_VERSION.
About Document-Level Events
Section link for About Document-Level EventsDoctype triggers scoped to DOCUMENT only fire on events that affect an entire document, rather than a specific document version. The majority of operations in Vault are executed against document versions, but there are some operations that are performed at the document level.
For example, the following operations are considered document-level events:
- Creating a new document
- Deleting a document, including delete operations on a document version if that version is the last remaining version for the document
Not all document-level events fire triggers. Specifically, because UPDATE doctype triggers can only update the latest version of a document, document-level events which update a document do not fire triggers.
In other words, all UPDATE triggers only fire on DOCUMENT_VERSION events and not on DOCUMENT events. Document-level events which update a document do not fire triggers.
For example, archiving a document in the Vault UI is considered a document-level event, but this does not fire DOCUMENT triggers. However, updating the archive__v field of a document version would fire DOCUMENT_VERSION triggers scoped to an UPDATE event.
Similarly, document check in and check out is considered a document-level event, but this does not fire DOCUMENT triggers. However, if checking in a document results in a new document version, this would fire DOCUMENT_VERSION triggers scoped to an INSERT event.