Hi,
I have also raised this issue with support. I created a script in a workflow tied to an external mail source consumption. This script has been working without error since September. On saturday, the script started throwing this error and I'm unsure why as nothing has changed. The error and my code are below.
M-Files Online
Kage {64CC5EF0-59F1-444C-BDD5-D237DB42471E}
Processing the contents of the external source "helpdesk@kageinnovation.com (outlook.office365.com)" failed.
The filename, directory name, or volume label syntax is incorrect.
ExternalFileMonitor.cpp, 7034, Processing the contents of the external source "helpdesk@kageinnovation.com (outlook.office365.com)" failed. (0x8004009F)
ExternalFileMonitor.cpp, 7034, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
ExternalFileMonitor.cpp, 446, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
ExternalFileMonitor.cpp, 628, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
MCallInLoop.h, 712, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
ExternalFileMonitor.cpp, 1571, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
ExternalFileMonitor.cpp, 1664, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
ExternalFileMonitor.cpp, 1828, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
ExternalFileMonitor.cpp, 3544, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
ExternalFileMonitor.cpp, 5513, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
ExternalFileMonitor.cpp, 5274, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
RPCDocumentOperationsHelper.cpp, 27866, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
RPCDocumentOperationsHelperPrivate.cpp, 2909, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
RPCDocumentOperationsHelperPrivate.cpp, 3121, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
RPCDocumentOperationsHelperPrivate.cpp, 3541, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
RPCDocumentOperationsHelperPrivate.cpp, 4380, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
VaultScriptSessionTemplates.cpp, 274, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
VaultScriptSessionTemplates.cpp, 339, Script execution failed. ((New or Existing Ticket_Help Desk Ticket Workflow, StateAction: 440-1229-1)) (0x800408BB)
VaultScriptSessionTemplates.cpp, 339, The filename, directory name, or volume label syntax is incorrect. (0x8007007B)
VaultScriptSessionTemplates.cpp, 522, The filename, directory name, or volume label syntax is incorrect. (0x8007007B)
CoActiveScriptSite.cpp, 895, The filename, directory name, or volume label syntax is incorrect. (0x8007007B)
CoActiveScriptSite.cpp, 737, The filename, directory name, or volume label syntax is incorrect. (0x8007007B)
New or Existing Ticket_Help Desk Ticket Workflow, StateAction, 33, The filename, directory name, or volume label syntax is incorrect. (0x8007007B)
CoVaultObjectFileOperations.cpp, 537, The filename, directory name, or volume label syntax is incorrect. (0x8007007B)
CoVaultObjectFileOperations.cpp, 511, The filename, directory name, or volume label syntax is incorrect. (0x8007007B)
ServerVaultObjectFileOperationsHelper.cpp, 209, The filename, directory name, or volume label syntax is incorrect. (0x8007007B)
(M-Files 21.12.10943.6)
Option Explicit
Dim objClassID: objClassID = Vault.ObjectPropertyOperations.GetProperty (objver,100).Value.GetValueAsLookup.DisplayID
If objClassID = 10524 then
Dim i, txFileTitle, tmpFolder, d, txExistingFileTitle, txNewFileTitle, myObjVer, c, ext
Dim ObjVerName: ObjVerName = PropertyValues.SearchForProperty(2455).TypedValue.DisplayValue 'name of the object
Dim MyString: MyString = PropertyValues.SearchForProperty(2456).TypedValue.DisplayValue 'Email Subject property which inherits the email subject line
MyString = FXDeleteCharFromString(MyString)
On Error Resume Next ' the Instr commands below may not find with they are looking for, so we just turn off error handling for the next line of code. We check it's validity in the next IF.
Dim ExistingHelpDeskID: ExistingHelpDeskID = Replace(Mid(MyString, 1 + Instr(MyString,"["), Instr(MyString,"]") - Instr(MyString,"[") - 1), "HD", "") 'search for a meaningfull id in the property that pulls in the email subject line
on error goto 0
If IsNumeric(ExistingHelpDeskID) = True and LEN(ExistingHelpDeskID) > 1 then ' check to make sure the ID is numeric and it did not error out when parsing from the email subject line
Set ExistingHelpDeskID = SearchForAnObject(ExistingHelpDeskID, False, "Help Desk Ticket")
If ExistingHelpDeskID.Count > 0 Then 'this means that it found a match from the id in the subject line to a Help Desk Ticket in the vault.
'find a matching title of the email subject line, ignoring the "RE", "FW" prefixes when looking for a match
'tmpFolder = CreateObject("WScript.Shell").ExpandEnvironmentStrings("%Temp%")
tmpFolder = "C:\Windows\Temp"
Set myObjVer = Vault.ObjectOperations.CheckOut(ExistingHelpDeskID.Item(1).ObjVer.Objid).ObjVer
'save the files from this new email and attachments onto a temp location on the server to be transferred to the existing object in M-Files
For Each i in Vault.ObjectFileOperations.GetFiles(ObjVer)
txNewFileTitle = FXDeleteCharFromString(i.Title)
'err.raise mfscriptcancel, txNewFileTitle
if i.Extension = "msg" then txNewFileTitle = MyString
ext = i.Extension
'err.raise mfscriptcancel, tmpFolder & "\" & txNewFileTitle & "." & ext
Vault.ObjectFileOperations.Downloadfile i.ID, i.Version, tmpFolder & "\" & txNewFileTitle & "." & ext
For each d in Vault.ObjectFileOperations.GetFiles(myObjVer) ' gets the files of the Help Desk Object it found as a match to the email subject
txExistingFileTitle = d.Title 'existing file title
if UCase(txExistingFileTitle) = UCase(txNewFileTitle) Then exit for
Next
if UCase(txExistingFileTitle) = UCase(txNewFileTitle) Then
Vault.ObjectFileOperations.UploadFile d.ID, d.Version, tmpFolder & "\" & txNewFileTitle & "." & ext ' pulls file from temp folder and overwrites the existing file in the existing warranty consdiration with a matching title to the subject line, less the RE: and FW:
'err.raise mfscriptcancel, tmpFolder & "\" & txNewFileTitle & "." & ext
CreateObject("Scripting.FileSystemObject").DeleteFile(tmpFolder & "\" & txNewFileTitle & "." & ext) ' delete file from temp folder
Else
Vault.ObjectFileOperations.AddFile myObjVer, txNewFileTitle, ext, tmpFolder & "\" & txNewFileTitle & "." & ext 'tmpFolder & "\" & txNewFileTitle & ext ' add new file to existing warranty claim if there is no existing file title to match the email subject line
'err.raise mfscriptcancel, tmpFolder & "\" & txNewFileTitle & "." & ext
'CreateObject("Scripting.FileSystemObject").DeleteFile(tmpFolder & "\" & txNewFileTitle & "." & ext)
' delete file from temp folder
End if
Next
If Vault.ObjectPropertyOperations.GetProperty(myobjver, 39).value.displayvalue = "Closed_Help Desk Ticket Workflow" then
Dim oPropVal: Set oPropVal = CreateObject("MFilesAPI.PropertyValue")
oPropVal.PropertyDef = 2442
oPropVal.TypedValue.SetValue MFDatatypeBoolean, ""
Vault.ObjectPropertyOperations.SetProperty myObjVer, oPropVal
Call ChangeState(10650, myobjver)
else
Call ChangeState(10647, myobjver)
end if
Vault.ObjectOperations.CheckIn(myObjVer)
Call ChangeState(10646, ObjVer)
else
Call ChangeState(10626, ObjVer) ' Set the workflow state to Initial Notification
end if
Else
Call ChangeState(10626, ObjVer) ' Set the workflow state to Initial Notification
End if
end if
'Functions Below
'===============================================================================================
Function ChangeState(iStateID, obObjVer)
' Set the workflow state to something
Dim oPropVal: Set oPropVal = CreateObject("MFilesAPI.PropertyValue")
oPropVal.PropertyDef = 39 ' Workflow states build-in property
oPropVal.TypedValue.SetValue MFDatatypeLookup, iStateID
Vault.ObjectPropertyOperations.SetProperty obObjVer, oPropVal
End Function
Function SearchForAnObject (txID, pDeleted, txClassName)
'txID as the textual value of the ID of the object you want to find
'pDeleted as Boolean for deleted or not
'txClassName as the textual name of the class you want to find
'Set up values to perform a search
Dim SC : Set SC = CreateObject("MFilesAPI.SearchCondition")
Dim SCS : Set SCs = CreateObject("MFilesAPI.SearchConditions")
Dim TV : Set TV = CreateObject("MFilesAPI.TypedValue")
Dim Ex : Set Ex = CreateObject("MFilesAPI.Expression")
'Set up places to hold the search results. results is just a collection.
'Property 1
TV.SetValue MFDatatypeText, txID
Ex.DataStatusValueType = MFilesAPI.MFStatusType.MFStatusTypeExtID
SC.Set Ex, MFConditionTypeEqual, TV
SCs.Add -1, SC
'Deleted or not
TV.SetValue MFilesAPI.MFDatatype.MFDatatypeBoolean, pDeleted
Ex.DataStatusValueType = MFilesAPI.MFStatusType.MFStatusTypeDeleted
SC.Set Ex, MFConditionTypeEqual, TV
SCs.Add -1, SC
'Class = 100, variable defines class "Name"
Ex.SetPropertyValueExpression 100, MFilesAPI.MFParentChildBehavior.MFParentChildBehaviorNone, Nothing
TV.SetValue MFDatatypeText, txClassName
SC.Set Ex, MFConditionTypeEqual, TV
SCs.Add -1, SC
'Returns ObjectSearchResults Collection of objects
Set SearchForAnObject = Vault.ObjectSearchOperations.SearchForObjectsByConditions(SCs, MFSearchFlagNone, False)
End Function
Function FXDeleteCharFromString(str)
Dim charArray: charArray = Array("\","/","*","?","'","<",">","|")
Dim replyArray: replyArray = Array("FW: ", "RE: ", "FW:", "RE:", "FWD: ", "FWD:")
Dim a
FXDeleteCharFromString = str
For each a in charArray
FXDeleteCharFromString = Replace (FXDeleteCharFromString, a, "_")
Next
For each a in replyArray
FXDeleteCharFromString = Replace (ucase(FXDeleteCharFromString), a, "")
Next
End Function
