Last modified in Fully automated workflow?

In my case all transitions are automatic based on different criteria. Now in every case last modified is M-Files server. I have user that could be used stored in property.

fUser = CurrentUserID
Dim oCurrentUserTypedValue : Set oCurrentUserTypedValue = CreateObject( "MFilesAPI.TypedValue" )
oCurrentUserTypedValue.SetValue MFDataTypeLookup, fUser
Vault.ObjectPropertyOperations.SetLastModificationInfoAdmin ObjVer, True, oCurrentUserTypedValue, False, Nothing

-> M-Files Server

fUser = 1322

-> M-Files Server

I have to use code in every transition so that M-Files accepts it. If M-Files would allow "infinite loops" I would not need code and I probably would get right Last modified.

So how do I get that code to work or some other way?


Parents Reply Children
  • That is way I've been trying to tackle this but without success.

    Workflow changes are activated by metadata change that is done by some user. Acceptance workflow for example.

    Document is in Review-state. I tick box that says Rejected and save -> workflow will jump to Rejected state and then automatically back to Review-state. All state changes are made by M-FIles server even though it was me who caused it in the first place. I have not found a place or way to change that user info.

  • In the described situation I would expect the "Review" state version to be caused by M-Files Server (it was the one who moved it back), but I would expect "Rejected" to be caused by the correct user.  The only way in which it would not is if you have some code altering the version as it is created (either an event handler or a state action).

    Do you?

  • Every transition happens happens by code, because there aren't any state where user can move manually.