I am trying to create an object type when the workflow is in the final stage. The object type is connected over an external source through API.
The idea is to notify some external system through object type creation.
on the workflow transition, I have added the following code in the workflow state PreConditions:
option explicit
Dim publishedReportObjectTypeAdmin
Set publishedReportObjectTypeAdmin = CreateObject("MFilesAPI.ObjTypeAdmin")
Dim publishedReportObjectType
Set publishedReportObjectType = CreateObject("MFilesAPI.ObjType")
publishedReportObjectType.ID = 129
publishedReportObjectType.AllowAdding = true
publishedReportObjectTypeAdmin.ObjectType = publishedReportObjectType
publishedReportObjectTypeAdmin.ConnectionString = "M-Files Extension={5417ed7c-d1a0-43bf-bbae-e84b398e6059};type=publishedreport"
'currently the values are hardcoded here just to test if it is working
publishedReportObjectTypeAdmin.InsertIntoStatement="INSERT INTO ( DocumentName, DocumentDate, DocumentCreator ) VALUES( 'testDoc', '12-04-2020', 'workflow' )"
Vault.ObjectTypeOperations.AddObjectTypeAdmin(publishedReportObjectTypeAdmin)
I get this error :
Incompatible isolation levels: "65536 -> 1048576".
How can I achieve the creation of object type on state transition ?