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
  • is there any example which does it.

    www.m-files.com/.../Connection_to_external_database.html

    Please note though that these create objects, not object types. If you truly do want to create object types then you will need a different approach, but from everything you've said I believe that you wish to create objects. You need to make sure that you're using the correct term.

    I would highly recommend that you engage with your M-Files reseller to get some guidance on how to do this, as the approach needed will depend significantly on the nuances of what you want to achieve.

    Regards,

    Craig.
Reply
  • is there any example which does it.

    www.m-files.com/.../Connection_to_external_database.html

    Please note though that these create objects, not object types. If you truly do want to create object types then you will need a different approach, but from everything you've said I believe that you wish to create objects. You need to make sure that you're using the correct term.

    I would highly recommend that you engage with your M-Files reseller to get some guidance on how to do this, as the approach needed will depend significantly on the nuances of what you want to achieve.

    Regards,

    Craig.
Children
No Data