Vault extension methods (IRPCVaultExtensionMethods)
Calls vault extension methods: server-side code in the vault that takes a string and returns a string.
| gRPC service | MFiles.IRPCVaultExtensionMethods |
|---|---|
| Book and level | Vault API, standard |
| Methods | 5 |
| Proto file | mfiles/IRPCVaultExtensionMethods.proto |
Overview
A vault extension method is custom server code that a client calls by name. There are two kinds:
- Event handler methods: event handlers of the type VaultExtensionMethod, written in
VBScript in M-Files Admin or registered by a vault application. They are identified by name
only. Call them with RunExtensionMethod
with an all-zero
application_id, or with ExecuteExtensionMethod. - Application extension methods: methods of an extension object of a vault application, identified by the application GUID, the extension, the instance and the method name. Call them with RunExtensionMethod or ExecuteExtensionMethodEx.
Prefer RunExtensionMethod: it covers both kinds and can compress large inputs and outputs. The input and output are free-form strings; their format is defined by the method. Each call runs in its own transaction.
ExecuteAnonymousExtensionMethod is for the web server that passes anonymous HTTP requests (webhooks) to a vault application.
Errors: an unknown event handler method fails with "Not found. (<name>)"; an unknown application
extension fails with The specified application "<extension>" does not exist..
Methods
| Method | Summary | Facts |
|---|---|---|
| ExecuteAnonymousExtensionMethod | Passes an anonymous HTTP request, such as a webhook call, to a vault application. Used by the M-Files web server. | write no session returns metadata structure version |
| ExecuteExtensionMethod | Runs an event handler method by name. In new code use RunExtensionMethod. | write session idempotent returns metadata structure version |
| ExecuteExtensionMethodEx | Runs an extension method of a vault application. In new code use RunExtensionMethod. | write session returns metadata structure version |
| IsExtensionMethodAvailable | Tells whether an event handler method with the given name exists and is active. | read session idempotent returns metadata structure version |
| RunExtensionMethod | Runs a vault extension method, either an event handler method or an application extension method, with optional compression of the input and output. | write session returns metadata structure version |