This page contains the following information:
Complete these common implementation tasks when developing custom event handlers:
- Add NuGet packages - ensure your Visual Studio project has installed the relevant NuGet packages, including at a minimum the Relativity.EventHandler and Relativity.Api packages.
- Inherit from the appropriate base class – extend the appropriate base class for the type of event handler that you want to develop. Each event handler type has a unique base class. For more information, see Develop object type event handlers or Develop application event handlers.
- Set the CustomAttribute.Name attribute – provide a description for the event handler that you want to appear in the Relativity UI.
- Add a GUID for the event handler – set the System.Runtime.InteropServices.Guid to the GUID identifying your event handler. Use the GUID generator in Visual Studio.
- Override the required methods and properties – ensure that you override the appropriate methods or properties for the type of event handler that you are developing. Most event handles require that you override the Execute() method by providing your own business logic. For specific event handler types, see Develop object type event handlers or Develop application event handlers.
Use event handlers to manipulate or validate data that users see or modify through the Relativity UI. The Relativity platform provides event handlers that support these methods of manipulating data:
- Validate data entered in forms by users before saving it. See Pre Save event handlers.
- Prevent users from deleting protected data. See Pre Cascade Delete event handlers and Pre Delete event handlers.
- Pre-populate field data in layouts before users see them. See Pre Load event handlers.
- Clean up queues or tracking tables when users delete data. See Pre Cascade Delete event handlers and Pre Delete event handlers.
- Control workflows by submitting jobs to a queue table, monitoring their progress, and resolving errors. See Console event handlers.