Pre Save event handlers
Pre Save event handlers execute after a user changes field values and clicks the Save or Save & Next button in Relativity. They run before the data on the object is written to the database, so you can use them to manipulate information before it's stored. These event handlers are supported on document objects and Relativity Dynamic Objects (RDOs). If the criteria for a pre-save process aren't met, you can cancel the operation.
For example, you can use Pre Save event handlers for the following tasks:
- Validating data.
- Auto-updating field values.
- Adding additional data during a save operation for coded information.
See this related page:
Guidelines for Pre Save event handlers
Use these guidelines when developing Pre Save event handlers:
- Inherit from PreSaveEventHandler – extend the PreSaveEventHandler base class.
- Override the Execute() method – add your business logic for the event handler to this method. This method runs when your event handler is triggered.
- Override the RequiredFields property – represents fields that are required on object creation.
- The ActiveArtifact.Fields collection includes the fields returned by the RequiredFields property, and those on the current layout. It also includes the values of these fields.
- Any Field in ActiveArtifact.Fields that is referenced in this event handler must be placed in the RequiredFields property.