Automatic State transition "Access denied" for non admin users

Hi,

Why do I have feeling that this has worked before but now it throws an error? Some windows update maybe? Or something in my code?

Any help really welcome. This is making me  insane

'BeforeCheckInChanges

' More code before but this is where it fails for non admin users

NextState = 101 'Lainassa
Dim NewState : Set NewState = CreateObject("MFilesAPI.PropertyValue")
NewState.PropertyDef = 39
NewState.Value.SetValue MFDataTypeLookup, NextState
Vault.ObjectPropertyOperations.SetProperty ObjVer, NewState

State transition from Valmis to Lainassa. Code activates that transition.

Activate state transition when code allows, but there no code behind that. Reason for this to hide manual transiotion.

And here is the error:

CoScriptObjectFactory.cpp, 465, Access denied. (0x800407E4)
ScriptErrorHelper.cpp, 96, Access denied. (0x800407E4)
MDispatchExImpl.h, 694, Access denied. (0x800407E4)
MDispatchExImpl.h, 994, Access denied. (0x800407E4)
MetadataCardAction.cpp, 386, Access denied. (0x800407E4)
MetadataCardAction.cpp, 570, Access denied. (0x800407E4)
MetadataEditor.cpp, 2967, Access denied. (0x800407E4)
MetadataModel.cpp, 4266, Access denied. (0x800407E4)
MetadataModel.cpp, 4703, Access denied. (0x800407E4)
ElectronicSignatureUIHelper.cpp, 235, Access denied. (0x800407E4)
MetadataModel.cpp, 12191, Access denied. (0x800407E4)
CoVaultMountingDocumentOperations.cpp, 3204, Access denied. (0x800407E4)
DocumentCache.cpp, 11283, Access denied. (0x800407E4)
DocumentCache.cpp, 11392, Access denied. (0x800407E4)
DocumentCache.cpp, 19559, Access denied. (0x800407E4)
RPCMethodCallWithRetry.h, 35, Access denied. (0x800407E4)
RPCMethodCallWithRetry.h, 35, Access denied. (0x800407E4)
RPCDocumentOperations.cpp, 12721, Access denied. (0x800407E4)
RPCDocumentOperations.cpp, 7386, Access denied. (0x800407E4)
MCallInLoop.h, 712, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 4170, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 3731, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 9381, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 9972, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 27544, Access denied. (0x800407E4)
RPCDocumentOperationsHelperPrivate.cpp, 2882, Access denied. (0x800407E4)
StateTransitionManager.cpp, 678, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 23872, Access denied. (0x800407E4)
RPCDocumentOperationsHelper.cpp, 23872, The state transition 'Valmis -> Lainassa' is not allowed. (0x800400C3)

Cheers

PJ
           

Parents Reply Children
  • You have a couple of options, but they boil down to making it so that it's the server that moves from state B to C.  From recollection there is a way to do this without code that involves a transitional state between the two; maybe I can ask one of the sales engineers to comment.

    Going down the code route the simple way is to allow the object to move into state B naturally, then use some asynchronous process (e.g. task queue) to load the object and move it to state C (this operation is then done by the server, so is allowed to do any state transition).

    I'll put a link to this on an internal Teams channel to see whether I can get someone to respond on the non-code way.

  • Automatic without code works fine but then I loose information who did that while that puts "M-Files Server" as last modified

  • I think these are two separate things.  But any automatic transition is, by definition, undertaken by the server.

    If this is the actual thing you want to resolve then you probably need some code on the Valmis state which loads the object history, finds who moved it to the Lainassa state, and calls "SetLastModificationInfoAdmin" to override what's saved: M-Files API