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

how to create an object type (in VB) on workflow state transition

Hello,

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 ?


Parents
  • Hi Craig,

    The object types I create manually on m-files basically fires an insert query over ODBC, which actually makes a POST Api call. The POST API call results on creation of object on the other system.

    My concern is :

    How do I pass data to other systems (from m-files), so that they can have the objects created on their end

    Is there some way to achieve this ?
Reply
  • Hi Craig,

    The object types I create manually on m-files basically fires an insert query over ODBC, which actually makes a POST Api call. The POST API call results on creation of object on the other system.

    My concern is :

    How do I pass data to other systems (from m-files), so that they can have the objects created on their end

    Is there some way to achieve this ?
Children
No Data