I am currently using the Vault Professional 2022 API to modify the states of a file by switching categories, then lifecycles, then to my desired state. This functionality works well any time I am working with a file that does not have the "Locked" icon on it, in which case it switches the file to my desired state. I also do have permissions to modify files that are Locked through the normal Vault UI. I can switch a file into a state that is locked, but any time I want to change the state of a file with the "Locked" icon on it I receive the following error:
Server stack trace:
at Autodesk.Connectivity.WebServices.ServiceBase`1.ServiceProxy`1.Invoke(MethodInfo methodInfo, Object[] args, TServiceInterface obj)
at Autodesk.Connectivity.WebServices.RealProxy`1.Invoke(IMethodCallMessage methodCallMsg, MethodInfo methodInfo, InvokeDelegate invokeFunc)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Autodesk.Connectivity.WebServices.IDocumentServiceExtensions.UpdateFileCategories(Int64[] masterIds, Int64[] categoryIds, String comment)
at VaultTest.Program.ChangeFileState(File file, String newState) in C:\Users\Program.cs
I am using WebServiceManager.DocumentServiceExtensions.UpdateFileCategories to update the category of the file, and then the WebServiceManager.DocumentServiceExtensions.UpdateFileLifeCycleDefinitions to update the lifecycle and state.
I suspect I am missing some security call to modify locked files but I cannot figure out what API call this may be.
Any help would be appreciated. Thanks
Solved! Go to Solution.
Solved by Markus.Koechl. Go to Solution.
You cannot update the file category if the file is locked. You would need an alternate user to have access to the update. The state change should work based on the state transition security setting.
So if I run these calls through an Administrator account it should work fine?
You should run the update category call through a secondary login with higher privileges only. The state change should remain for the logged-in (and licensed) user. Note - the concept of running a secondary (Vault user) connection is only valid for named user licensing while a primary connection covers license authentication for the current session/machine.
Can't find what you're looking for? Ask the community or share your knowledge.