M-Files API 23.11.13135.0
ExecuteVaultExtensionMethod Method
VaultExtensionMethodOperations Object : ExecuteVaultExtensionMethod Method
The name of the extension method as seen in the "Event Handlers" dialog of M-Files Admin (under the "VaultExtensionMethod" node). The name is case insensitive.
The input parameters given to the extension method. String content specified by the event handler.
Description
Executes the specified vault extension method.
Syntax
Visual Basic
Public Function ExecuteVaultExtensionMethod( _
   ByVal MethodIdentifier As String, _
   ByVal Input As String _
) As String
Parameters
MethodIdentifier
The name of the extension method as seen in the "Event Handlers" dialog of M-Files Admin (under the "VaultExtensionMethod" node). The name is case insensitive.
Input
The input parameters given to the extension method. String content specified by the event handler.
Remarks
The developer of the vault extension method must make sure that the user can be allowed to execute the method. In other words, the method should check the identity of the calling user and terminate if they do not have the required administrative rights in the vault.
Example
Example usage of the "ExecuteVaultExtensionMethod".
// Connect to Sample Vault using M-Files Client.
var mfilesClient = new ActiveXObject( "MFilesAPI.MFilesClientApplication" );
var vault = mfilesClient.BindToVault( "Sample Vault", 0, true, false );

// Get the result from the "ObjectTypeIsOK" method.
var result = vault.ExtensionMethodOperations.ExecuteVaultExtensionMethod( "ObjectTypeIsOK", "3" );
if( result )
{
  // OK to proceed.
} else {
  // Display an error.
}
The event handler verifies that the object type ID is either "0" or "9" and returns the result.
If Input = "0" or Input = "9" Then
   Output = True
Else
   Output = False
End If
See Also

VaultExtensionMethodOperations Object  | VaultExtensionMethodOperations Members