Event Handlers
Note: This content is no longer updated.
For the latest content, please go to the user guide for M-Files Online. For information on the supported product
versions, refer to our lifecycle policy.
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 via 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.
Note: The M-Files
API documentation is available online:
M-Files API. For more information
about using VBScript in M-Files, see the How do I write VBScript code for M-Files purposes?
tutorial.
Do the following steps to create a new event handler: