Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vault API: Locked file modifications

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
cpaladinoA8ZXR
296 Views, 4 Replies

Vault API: Locked file modifications

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

4 REPLIES 4
Message 2 of 5

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.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
Message 3 of 5

So if I run these calls through an Administrator account it should work fine?

Message 4 of 5

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.



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe
Message 5 of 5

Thanks a lot for the help Markus.

 

Carl

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report