This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Not Found error on Event handler

Hello,

I am trying currently to create an event handler which checks two pairs of properties to have values in either of them. When all four properties are empty I get the first error which I put in the script, then if I fill in either of them I get the second error. Until now everything works, but when both pairs have at least one property filled in the Not Found error is raised and I cannot create the document.
Option Explicit

Dim PropertyValues : Set PropertyValues = Vault.ObjectPropertyOperations.GetProperties( ObjVer, true )

If PropertyValues.SearchForProperty(100).TypedValue.GetLookupID = 55 Then

Dim szLegalScope : szLegalScope = PropertyValues.SearchForProperty(1360).TypedValue.DisplayValue
Dim szOrg : szOrg = PropertyValues.SearchForProperty(1397).TypedValue.DisplayValue
Dim szFormalApprovers : szFormalApprovers = PropertyValues.SearchForProperty(1373).TypedValue.DisplayValue
Dim szFormalApproversEB : szFormalApproversEB = PropertyValues.SearchForProperty(1463).TypedValue.DisplayValue

If szOrg = "" And szLegalScope = "" Then
Err.Raise MFScriptCancel , "Please fill in either Employer Scope or Organizational Scope."
ElseIf szFormalApprovers = "" And szFormalApproversEB = "" Then
Err.Raise MFScriptCancel , "Please fill in either Formal Approvers or Formal Approvers EB."
End If
End If



The full error message is this one:

CoScriptObjectFactory.cpp, 271, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
ScriptErrorHelper.cpp, 96, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
MDispatchExImpl.h, 679, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
MDispatchExImpl.h, 826, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
MetadataCardAction.cpp, 386, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
MetadataCardAction.cpp, 570, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
MetadataEditor.cpp, 2621, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
MetadataModel.cpp, 4226, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
MetadataModel.cpp, 4971, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
CoVaultMountingDocumentOperations.cpp, 190, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
CoVaultMountingDocumentOperations.cpp, 399, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
DocumentCache.cpp, 1252, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
DocumentCache.cpp, 4811, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
DocumentCache.cpp, 4920, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
DocumentCache.cpp, 5160, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
RPCMethodCallWithRetry.h, 36, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
RPCMethodCallWithRetry.h, 36, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
RPCDocumentOperations.cpp, 13007, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
RPCDocumentOperations.cpp, 8549, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
MCallInLoop.h, 620, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
RPCDocumentOperationsHelper.cpp, 3027, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
VaultDBSessionEvents.cpp, 314, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
VaultDBSessionEvents.cpp, 1552, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
VaultScriptSessionTemplates.cpp, 269, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
VaultScriptSessionTemplates.cpp, 328, Script execution failed. ((BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize: 7086-1)) (0x800408BB)
VaultScriptSessionTemplates.cpp, 328, Not found. (0x8004000B)
VaultScriptSessionTemplates.cpp, 500, Not found. (0x8004000B)
CoActiveScriptSite.cpp, 903, Not found. (0x8004000B)
CoActiveScriptSite.cpp, 745, Not found. (0x8004000B)
BeforeCreateNewObjectFinalize::MFiles.ComplianceKit.MFEventHandlerBeforeCreateNewObjectFinalize, 22, Not found. (0x8004000B)
CoDynamicCLRObjectWrapper.cpp, 552, Not found. (0x8004000B)
CoDynamicCLRObjectWrapper.cpp, 322, Not found. (0x8004000B)
ManagedError.cpp, 129, Not found. (0x8004000B)
VaultApplicationBase.cs, 664 (IL:77), Not found. (0x8004000B)
MethodInfo.cs, 228 (IL:105), Not found. (0x8004000B)
VersionControlModule.cs, 383 (IL:53), Not found. (0x8004000B)
WorkingCopy.cs, 1418 (IL:25), Not found. (0x8004000B)
ControlledDocument.cs, 1138 (IL:288), Not found. (0x8004000B)
M-Files Compliance Kit 3.0.777.35: [MFilesAPI.ObjectVersionAndProperties CreateNewObjectEx(Int32, MFilesAPI.PropertyValues, MFilesAPI.SourceObjectFiles, Boolean, Boolean, MFilesAPI.AccessControlList)], IL:-1, Not found. (0x8004000B)
CoVaultObjectOperations.cpp, 2192, Not found. (0x8004000B)
ServerVaultObjectOperationsHelper.cpp, 1092, Not found. (0x8004000B)
ServerVaultObjectOperationsHelper.cpp, 1368, Not found. (0x8004000B)
ServerVaultObjectOperationsHelper.cpp, 1600, Not found. (0x8004000B)
RPCObjectOperationsHelper.cpp, 443, Not found. (0x8004000B)
CoRPCOverCOM.cpp, 5389, Not found. (0x8004000B)
RPCDocumentOperations.cpp, 5596, Not found. (0x8004000B)
MCallInLoop.h, 620, Not found. (0x8004000B)
RPCDocumentOperationsHelper.cpp, 2415, Not found. (0x8004000B)
RPCDocumentOperationsHelper.cpp, 2549, Not found. (0x8004000B)
VaultDBSessionEvents.cpp, 314, Not found. (0x8004000B)
VaultDBSessionEvents.cpp, 1552, Not found. (0x8004000B)
VaultScriptSessionTemplates.cpp, 269, Not found. (0x8004000B)
VaultScriptSessionTemplates.cpp, 334, Not found. (0x8004000B)
VaultScriptSessionTemplates.cpp, 500, Not found. (0x8004000B)
CoActiveScriptSite.cpp, 903, Not found. (0x8004000B)
CoActiveScriptSite.cpp, 745, Not found. (0x8004000B)
BeforeCreateNewObjectFinalize::EnsureFormalApprovers, 9, Not found. (0x8004000B)
CoPropertyValues.cpp, 348, Not found. (0x8004000B)
(M-Files 19.7.8028.5)


Do you think you can help me?
BR,
BlackRose
Parents
  • The error message says that your error origins from line 9 in your script (szFormalApprovers).
    Is that property present at all on the object that you are testing?
    You probably should add some lines in the beginning of your code to ensure that your Event Handler only runs on Object Type = Document, Class = xxxx and so on. And you should check whether each of the properties used later on exist on the object.
    This topic may help you get started community.m-files.com/index.php
Reply
  • The error message says that your error origins from line 9 in your script (szFormalApprovers).
    Is that property present at all on the object that you are testing?
    You probably should add some lines in the beginning of your code to ensure that your Event Handler only runs on Object Type = Document, Class = xxxx and so on. And you should check whether each of the properties used later on exist on the object.
    This topic may help you get started community.m-files.com/index.php
Children
No Data