BeforeCreateNewObjectFinalize and External Objects

We have an event handler script that explicitly excludes an externally maintained Project object:

' Get the user name
Dim userAccount
Set userAccount = Vault.UserOperations.GetUserAccount(CurrentUserID)
Dim vloginName
vloginName = userAccount.LoginName

'Get instance of Property values
Dim oPropVals: Set oPropVals = CreateObject("MFilesApi.PropertyValues")
Set oPropVals = Vault.ObjectPropertyOperations.GetProperties(ObjVer)

currentTitle = oPropVals.SearchForProperty(MFBuiltInPropertyDefNameOrTitle).TypedValue.Value

currentClass = oPropVals.SearchForProperty(MFBuiltInPropertyDefClass).TypedValue.DisplayValue


If ( currentClass <> "Project") Then
If ( ( (InStr(1, currentTitle, "!") > 0) _
or (InStr(1, currentTitle, "~") > 0) _
or (InStr(1, currentTitle, "@") > 0) _
or (InStr(1, currentTitle, "#") > 0) _
or (InStr(1, currentTitle, "%") > 0) _
or (InStr(1, currentTitle, "^") > 0) _
or (InStr(1, currentTitle, "&") > 0) _
or (InStr(1, currentTitle, "*") > 0) _
or (InStr(1, currentTitle, "?") > 0) ) _
and (InStr(1, vloginName, "mf_service") = 0) ) _
Then
Err.Raise MFScriptCancel, "Please remove the special characters in " + currentTitle
End If
End If

Yet, full refreshes of the Project object fail to complete.  Watching the refreshing status, I can see that objects are not updated or inserted.

Parents Reply
  • If your event handler changes a property that is used in synchronization with the external source, then you need to make sure the synchronization includes correct Update and Insert statements including the properties being changed and, of course, that the external database offers permission to change those properties to the user account used for the synchronization.

    Have you checked the event log to see which errors are generated?

Children