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
  • I am unsure why you want to create an "object type", though. Surely these are simply objects of type "Published Reports for SYSTEM B", rather than new object types?

    You say this:
    Manually I am able to create/update/get object types of this over the REST API

    You are certainly not able to create object types over the REST API. It does not support this. You can create objects, which is what I think you want to do.

    I would not try and modify the vault structure during any operation like this (it seems that the vault instance you have does not have the ability to anyway).

    Regards,

    Craig.
Reply
  • I am unsure why you want to create an "object type", though. Surely these are simply objects of type "Published Reports for SYSTEM B", rather than new object types?

    You say this:
    Manually I am able to create/update/get object types of this over the REST API

    You are certainly not able to create object types over the REST API. It does not support this. You can create objects, which is what I think you want to do.

    I would not try and modify the vault structure during any operation like this (it seems that the vault instance you have does not have the ability to anyway).

    Regards,

    Craig.
Children
No Data