Reference - Global system events
Event categories (classes):
- ObjectEvents
- ContentItemEvents
- WebPageEvents
- HeadlessItemEvents
- Workflow events
- DataProtectionEvents
- EventLogEvents
- BizFormItemEvents
- ContactManagementEvents
- ActivityEvents
- SystemEvents
- SqlEvents
- Application events
ObjectEvents
Namespace: CMS.DataEngine
Contains events that occur for all types of objects in the system. See also: Handle object events
Important
Use the following classes to access the object events in the API:
- ObjectEvents – events triggered for all object types
- <name>Info.TYPEINFO.Events – events triggered only for a specific object type, for example:
UserInfo.TYPEINFO.Events
Event | Event types | Handler parameters | Description |
Insert | Before | ObjectEventArgs Properties
| Occurs when a new object is created. To reliably handle all possible object creation events, you may also need to assign a matching handler to the BulkInsert event. The system triggers the BulkInsert event instead of Insert in certain cases, particularly for operations that can affect multiple objects. |
Update | Before | ObjectEventArgs Properties
| Occurs when the data of an existing object is updated. To reliably handle all possible object update events, you may also need to assign a matching handler to the BulkUpdate event. The system triggers the BulkUpdate event instead of Update in certain cases, particularly for operations that can affect multiple objects. |
Delete | Before | ObjectEventArgs Properties
| Occurs when an object is deleted. To reliably handle all possible object deletion events, you may also need to assign a matching handler to the BulkDelete event. The system triggers the BulkDelete event instead of Delete in certain cases, particularly for operations that can affect multiple objects. |
BulkInsert | Before | BulkInsertEventArgs Properties
| Occurs when the system performs object creation operations that can affect multiple objects. To reliably handle all possible object creation events, assign matching handlers to both the BulkInsert and Insert events. |
BulkUpdate | Before | BulkUpdateEventArgs Properties
| Occurs when the system performs object update operations that can affect multiple objects. To reliably handle all possible object update events, assign matching handlers to both the BulkUpdate and Update events. |
BulkDelete | Before | BulkDeleteEventArgs Properties
| Occurs when the system performs object deletion operations that can affect multiple objects. To reliably handle all possible object deletion events, assign matching handlers to both the BulkDelete and Delete events. |
Sort | Before | ObjectSortEventArgs Properties
| Occurs when sorting of objects is requested. |
ChangeOrder | Before | ObjectChangeOrderEventArgs Properties
| Occurs when a change in the order of objects is requested. |
GetData | Before | ObjectDataEventArgs Properties
| Occurs when the system retrieves object data using the ObjectQuery API. The Before event type is suitable, for example, when you want to retrieve data from an external source. Assign the external data into the Data property of the handler’s ObjectDataEventArgs parameter, which is empty by default in the Before event. Use the After event type if you need to edit the data retrieved from Xperience in the Data property. The Total Records property provides a number of total records in case paging is used. Use -1 to use the rows count of the Data property. |
> Back to list of event categories
ContentItemEvents
Namespace: CMS.ContentEngine
Contains events that occur when changes are made to content items.
Event | Event types | Handler | Handler parameters | Description |
Create | Before | Advanced handler | CreateContentItemEventArgs | Occurs when a new content item (not a language variant) is created. |
CreateLanguageVariant | Before | Advanced handler | CreateContentItemLanguageVariantEventArgs | Occurs when a new language variant of an existing content item is created. |
UpdateDraft | Before | Advanced handler | UpdateContentItemDraftEventArgs | Occurs when a draft is updated. |
Publish | Execute | Basic handler | PublishContentItemEventArgs | Occurs when an item is published. Also triggers when the system publishes an item that was scheduled to be published. The scheduling action itself triggers the |
Unpublish | Execute | Basic handler | UnpublishContentItemEventArgs | Occurs when an item is unpublished. Also triggers when the system unpublishes an item that was scheduled to be unpublished. The scheduling action itself triggers the |
Delete | Execute | Basic handler | DeleteContentItemEventArgs | Occurs when an item is deleted. |
UpdateMetadata | Before | Advanced handler | UpdateContentItemMetadataEventArgs | Occurs when an item’s metadata is updated (e.g., security settings). |
UpdateLanguageMetadata | Before | Advanced handler | UpdateContentItemLanguageMetadataEventArgs | Occurs when an item’s language variant-specific metadata is updated (e.g., administration display name). This metadata includes the time when an item is scheduled to be published or unpublished. As a result, scheduling an item to be published or unpublished (or canceling a scheduled publish action) triggers the |
General information
Events are not cancelable. If you try to cancel an event, an exception is thrown instead. You can also throw exceptions to stop the corresponding operation. For example, an exception thrown from an event while creating an object will roll back the transaction.
Event handlers
Advanced handler
Events handled by advanced handlers expose property setters in their event args that can be used to further modify the item before it is stored in the database. Content type-specific data can be updated via the ContentItemData
property, if present.
Basic handler
Events handled by basic handlers are only used for notification.
> Back to list of event categories
WebPageEvents
Namespace: CMS.Websites
Contains events that occur when changes are made to pages.
Event | Event types | Handler | Handler parameters | Description |
Create | Before | Advanced handler | CreateWebPageLanguageVariantEventArgs | Occurs when a new page is created. |
CreateFolder | Before | Advanced handler | CreateFolderLanguageVariantEventArgs | Occurs when a new folder is created. |
CreateLanguageVariant | Before | Advanced handler | CreateWebPageLanguageVariantEventArgs | Occurs when a new page language variant is created. |
CreateFolderLanguageVariant | Before | Advanced handler | CreateFolderLanguageVariantEventArgs | Occurs when a new folder language variant is created. |
UpdateDraft | Before | Advanced handler | UpdateWebPageDraftEventArgs | Occurs when a page draft is updated. |
Publish | Execute | Basic handler | PublishWebPageEventArgs | Occurs when a page is published. Also triggers when the system publishes a page that was scheduled to be published. The scheduling action itself triggers the |
Unpublish | Execute | Basic handler | UnpublishWebPageEventArgs Also triggers when the system unpublishes a page that was scheduled to be unpublished. The scheduling action itself triggers the | Occurs when a page is unpublished. |
Move | Execute | Basic handler | MoveWebPageEventArgs | Occurs when a page is moved. |
UpdateMetadata | Before | Advanced handler | UpdateWebPageMetadataEventArgs | Occurs when page properties are updated. |
UpdateTreePathSlug | Before | Advanced handler | UpdateWebPageTreePathSlugEventArgs | Occurs when the page URL slug is changed. |
UpdateSecuritySettings | Before | Advanced handler | UpdateWebPageSecuritySettingsEventsArgs | Occurs when page security settings are updated. |
Delete | Execute | Basic handler | DeleteWebPageEventArgs | Occurs when a page is deleted. |
UpdateLanguageMetadata | Before | Advanced handler | UpdateWebPageLanguageMetadataEventArgs | Occurs when a page’s language variant-specific metadata is updated (e.g., administration display name). This metadata includes the time when a page is scheduled to be published pr unpublished. As a result, scheduling a page to be published or unpublished (or canceling the scheduled publish action) triggers the |
General information
Events are not cancelable. If you try to cancel an event, an exception is thrown instead. You can also throw exceptions to stop the corresponding operation. For example, an exception thrown from an event while creating an object will roll back the transaction.
Event handlers
Advanced handler
Events handled by advanced handlers expose property setters in their event args that can be used to further modify the item before it is stored in the database. Content type-specific data can be updated via the ContentItemData
property, if present.
Basic handler
Events handled by basic handlers are only used for notification.
> Back to list of event categories
HeadlessItemEvents
Namespace: CMS.ContentEngine
Contains events that occur when changes are made to headless items.
Event | Event types | Handler | Handler parameters | Description |
Create | Before | Advanced handler | CreateHeadlessItemEventArgs | Occurs when a new headless item (not a language variant) is created. |
CreateLanguageVariant | Before | Advanced handler | CreateHeadlessItemLanguageVariantEventArgs | Occurs when a new language variant of an existing headless item is created. |
UpdateDraft | Before | Advanced handler | UpdateHeadlessItemDraftEventArgs | Occurs when a headless item draft is updated. |
Publish | Execute | Basic handler | PublishHeadlessItemEventArgs | Occurs when a headless item is published. |
Unpublish | Execute | Basic handler | UnpublishHeadlessItemEventArgs | Occurs when a headless item is unpublished. |
Delete | Execute | Basic handler | DeleteHeadlessItemEventArgs | Occurs when a headless item is deleted. |
UpdateMetadata | Before | Advanced handler | UpdateHeadlessItemMetadataEventArgs | Occurs when a headless item’s metadata is updated (e.g., security settings). |
UpdateLanguageMetadata | Before | Advanced handler | UpdateHeadlessItemLanguageMetadataEventArgs | Occurs when a headless item’s language metadata is updated (e.g., admin UI display name). |
General information
Events are not cancelable. If you try to cancel an event, an exception is thrown instead. You can also throw exceptions to stop the corresponding operation. For example, an exception thrown from an event while creating an object will roll back the transaction.
Event handlers
Advanced handler
Events handled by advanced handlers expose property setters in their event args that can be used to further modify the item before it is stored in the database. Content type-specific data can be updated via the ContentItemData
property, if present.
Basic handler
Events handled by basic handlers are only used for notification.
> Back to list of event categories
Workflow events
Namespace: CMS.ContentWorkflowEngine
The following classes contain events related to items under workflow:
WebPageWorkflowEvents
– for pages in website channels.ContentItemWorkflowEvents
– for reusable content items in the Content hub.HeadlessItemWorkflowEvents
– for headless items in headless channels.
Event | Event types | Handler parameters | Description |
MoveToStep | Execute | WebPageWorkflowMoveToStepArguments ContentItemWorkflowMoveToStepArguments HeadlessItemWorkflowMoveToStepArguments | Occurs when a page/content item/headless item is moved from one workflow step to another. The event arguments allow you to access the name of the current and original workflow step, the user who changed the step, and also properties of the given page, content item or headless item (ID, name, content type, language, etc.). The event is not triggered when an item is published or scheduled to be published. For publish transitions, you need to handle the Example: Set up custom workflow notifications |
> Back to list of event categories
DataProtectionEvents
Namespace: CMS.DataProtection
Contains events related to protection of personal data in the system.
Event | Event types | Handler parameters | Description |
RevokeConsentAgreement | Execute | RevokeConsentAgreementEventArgs Properties
| Occurs when a consent agreement is revoked. When a contact’s consent agreement is revoked, this event can be used to perform custom actions, such as terminating tracking of the contact or deleting personal data related to the contact. See also: Consent management, Consent development |
> Back to list of event categories
EventLogEvents
Namespace: CMS.EventLog
Contains events that occur when logging records into the system’s event log.
Event | Event types | Handler parameters | Description |
LogEvent | Before | LogEventArgs Properties
| Occurs when the system logs a record into the event log. You can use the Before event to customize the data logged for events or cancel logging for certain types of events. The After event allows you to perform custom actions after events are successfully logged. See also: Customize event logging |
> Back to list of event categories
BizFormItemEvents
Namespace: CMS.OnlineForms
Contains events related to form actions. See Handle form events for an example.
Event | Event types | Handler parameters | Description |
Insert | Before | BizFormItemEventArgs Properties
| Occurs when inserting new form items (data records of forms). |
Update | Before | BizFormItemEventArgs Properties
| Occurs when updating form data records. |
Delete | Before | BizFormItemEventArgs Properties
| Occurs when deleting data records from forms. |
> Back to list of event categories
ContactManagementEvents
Namespace: CMS.ContactManagement
Event | Event types | Handler parameters | Description |
ContactInfosDeleted | Execute | ContactInfosDeletedHandlerEventArgs Properties
| Occurs when multiple contacts are deleted. When a single contact is deleted, the TypeInfoEvents.Delete event can be used on ContactInfo.TYPEINFO. |
> Back to list of event categories
ActivityEvents
Namespace: CMS.Activities
Event | Event types | Handler parameters | Description |
ActivityBulkInsertPerformed | Before | CMSEventArgs<IList<IActivityInfo>> | Occurs when the system processes digital marketing activities that are logged in memory and inserts them into the database. |
ActivityProcessedInLogService | Execute | CMSEventArgs<IActivityInfo> | Occurs when a digital marketing activity is logged and processed. At this point, the activity is only stored in the application memory (activities are regularly processed and saved in bulk to the database – see the ActivityBulkInsertPerformed event). |
> Back to list of event categories
SystemEvents
Namespace: CMS.Base
Contains general system events.
Event | Event types | Handler parameters | Description |
Exception | Execute | SystemEventArgs Properties
| Fires when an unhandled exception occurs in the system. |
> Back to list of event categories
SqlEvents
Namespace: CMS.DataEngine
Contains events related to the execution of queries and other database operations.
Event | Event types | Handler parameters | Description |
BulkInsert | Before | BulkInsertDataEventArgs Properties
| Occurs when the system creates objects by directly inserting data into a database table. |
ExecuteQuery | Before | ExecuteQueryEventArgs<DataSet> Properties
| Occurs when the system executes a DataSet database query. |
ExecuteNonQuery | Before | ExecuteQueryEventArgs<int> Properties
| Occurs when the system executes a non-query database operation. |
ExecuteScalar | Before | ExecuteQueryEventArgs<object> Properties
| Occurs when the system executes a scalar query. |
ExecuteReader | Before | ExecuteQueryEventArgs<DbDataReader> Properties
| Occurs when the system runs a database DataReader, e.g., when the system (or custom code) materializes an ObjectQuery or content item query call, typically by enumerating the results. |
Application events
Xperience provides a set of events that you can use to customize the global behavior of the application.
ApplicationEvents
Namespace: CMS.Base
Contains events related to the application life cycle.
The following table lists the events that occur once in the application’s life cycle, in order of execution:
Event | Event types | Handler parameters | Description |
PreInitialized | Execute | Occurs when the application finishes pre-initialization (preparation of things unrelated to the database). Handlers need to be assigned in the PreInit method of custom modules. | |
Initialized | Execute | Occurs when the application finishes initialization and starts (including all modules and the database connection). Handle this event to perform standard application start events. | |
PostStart | Execute | Occurs at the end of the first application request. Allows you to perform asynchronous tasks needed for application startup. Running long operations within this event’s handlers can negatively affect the response time of the first request when starting the application. | |
End | Execute | Occurs when the application ends. |
The following events occur as needed during the application life cycle:
Event | Event types | Handler parameters | Description |
Error | Execute | Fires when an error occurs in the application. |
RequestEvents
Namespace: CMS.Base
Contains events related to the handling of requests.
The following table lists available events in the order they are invoked by the application:
Event | Event type | Handler parameters | Description |
Prepare | Execute | Occurs before request processing begins. | |
Begin | Execute | Occurs when request processing starts. | |
PreSendRequestHeaders | Execute | Occurs just before ASP.NET sends HTTP headers to the client. Note: Added delegates are invoked during HttpResponse.OnStarting. | |
End | Execute | Occurs at the end of request processing. | |
RunEndRequestTasks | Execute | Allows you to execute background tasks at the end of request processing. Running long tasks in this event’s handlers can negatively affect the response time of requests. | |
Finalize | Execute | Occurs when the request is finalized. Use to clean up and release any resources used by the request. Running long tasks in this event’s handlers can negatively affect the response time of requests. |