**Source URL:** https://limited.veevavault.dev/medical/mdl/component-types/documenttypetrigger

# Documenttypetrigger

**Class:** `code`

Doctype triggers execute Vault Java SDK code when a document or document version is created, updated, or deleted.

Learn more about [Doctype Triggers](/vault-sdk/entry-points/triggers/doctype-triggers/).

| Attribute | Metadata | Description |
| --- | --- | --- |
| `label` | Type: String Max length: 60 | UI-friendly string in the Vault's base language. |
| `active` | Type: Boolean | Indicates whether the component is active. |
| `checksum` | Type: String Max length: 1500 | Used to check data for errors. |
| `document_type` | Type: Component **Required** | Reference to a `Doctype` component. If set to the *Base* document type, this trigger will fire for all documents. |
| `event_segment` | Type: Enum Allowed values: PRE\_CUSTOM; POST\_CUSTOM; UNSPECIFIED | For internal Veeva use only. |
| `events` | Type: Enum Multi-value Allowed values: BEFORE\_UPDATE; AFTER\_UPDATE; BEFORE\_DELETE; AFTER\_DELETE; BEFORE\_INSERT; AFTER\_INSERT | Specifies the type of data change that causes this trigger fire. Learn more about [Doctype Trigger Events](/vault-sdk/entry-points/triggers/doctype-triggers/about-doctype-trigger-events/). |
| `level` | Type: Enum Allowed values: DOCUMENT; DOCUMENT\_VERSION | Determine if a trigger fires when data operations occur at the document version level or the document level. Learn more about [Doctype Trigger Event Levels](/vault-sdk/entry-points/triggers/doctype-triggers/about-doctype-trigger-event-levels/). |
| `order` | Type: Enum Allowed values: NUMBER\_1; NUMBER\_2; NUMBER\_3; NUMBER\_4; NUMBER\_5; NUMBER\_6; NUMBER\_7; NUMBER\_8; NUMBER\_9; NUMBER\_10; UNSPECIFIED | The order in which to fire the trigger. If not specified, the order is equivalent to `NUMBER_10`. |
| `source_code` | Type: SdkCode Max length: 1048576 | The Vault Java SDK source code for the trigger. |

### Supported Operations

| Operation | Support |
| --- | --- |
| Create | No |
| Recreate | No |
| Alter | No |
| Drop | No |
| Rename | No |
| Describe | No |
| Generate Recreate | No |
| Queryable | Yes |

---

**Previous:** [Documentstagegroup](/medical/mdl/component-types/documentstagegroup)  
**Next:** [Emailprocessor](/medical/mdl/component-types/emailprocessor)