Event Handlers
With event handlers, you can define different operations that are executed when certain events occur, such as after an object is modified or before a new value list item is created. The operations are specified using variables, generic features of VBScript, and M-Files API.
Examples of event handler use:
- Object permissions can be set to change automatically when the object properties are changed.
- Certain basic documents can be added to every new project through a pre-defined project model.
- Specified Word documents can always be saved as PDFs, so that when a Word file is checked in, it is saved to the server in PDF format as well.
- Data related to photos, such as date and image size, can be automatically added to the metadata of the photo document.
- If the user adds a new value to the value list, the event handler can be used to check that the added value is entered correctly.
- Logging in to M-Files can be prevented outside working hours, for instance during night time and weekends.
- Downloading certain files can be monitored, downloading large numbers of files can be prevented, or an alarm of suspicious downloads can be sent to the administrator.
Do the following steps to create a new event handler: