Event handlers
With event handlers, you can specify operations to take place automatically when certain events occur. For example, after an object is edited or before a new value list item is created.
Important: When you develop new extensions or
edit existing ones, we recommend that you replace VBScript
content with Vault Application Framework (VAF) compatible
code for future compatibility. For information on the benefits of
VAF over VBScript,
refer to The Vault Application Framework in M-Files Developer
Portal.
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 predefined 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.
To create an event handler: