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: 

Error updating property values when calling UpdateFileProperties more than once

2 REPLIES 2
Reply
Message 1 of 3
franco_alamo
629 Views, 2 Replies

Error updating property values when calling UpdateFileProperties more than once

I have a C# application that I'm working on to add a drawing to Vault and then update its properties. I am using the method UpdateFileProperties from the Autodesk.Connectivity.Explorer.ExtensibilityTools class. The first time it gets invoked it works fine, but as soon as I try to update the properties on a second drawing, I get an error saying "Error updating property values". I read on another post that this issue was fixed by SP1, but I verified the server and the desktop application version are both at 17.1.16.0 Update 1. I also verified the ExtensibilityTools dll I was using was at version 17.1.16.0. I've attached screenshots of the about page as well as the error being generated in Visual Studio. I'm also pasting my code below in case there is some mistake that I am making that is causing the problem. I'm hoping someone can help with this issue.

 

public void ChangeVaultProperties(Autodesk.Connectivity.WebServices.File newDrawing, string[] newPropertyValue)
{
   //Example of newPropertyValue
   //string[] newPropertyValue = new string[] { "DocumentNameTest", "SomeExport" }

 

   IWebServiceCredentials credentials = new WinAuthCredentials("servername", "VaultName");


   using (WebServiceManager mgr = new WebServiceManager(credentials))
   {
      if (vaultExplorer == null)
          vaultExplorer = ExplorerLoader.LoadExplorerUtil( "ServerName",
                                                                                   "VaultName",
                                                                                   mgr.SecurityService.SecurityHeader.UserId,
                                                                                   mgr.SecurityService.SecurityHeader.Ticket);

      PropertyService propertyService = mgr.PropertyService;
      PropDefInfo[] propertyInfos = propertyService.GetPropertyDefinitionInfosByEntityClassId("FILE", null);
      string[] propertyName = new string[] { "Document Number", "Export Class" }
      PropDef filenameProperty;
      Dictionary<PropDef, object> props = new Dictionary<PropDef, object>();

      for (int i = 0; i < propertyName.Count(); i++)
      {
         filenameProperty = propertyInfos.Select(pi => pi.PropDef)
              .Where(pd => pd.DispName.Equals(propertyName[i], StringComparison.OrdinalIgnoreCase))
              .FirstOrDefault();
         props.Add(filenameProperty, newPropertyValue[i]);
      }

      vaultExplorer.UpdateFileProperties(newDrawing, props);
   }
}

 

 

The properties I am changing are both User Defined:

 

Document Number is of Data Type Text.

Export Class is also of Data Type Text.

 

 

2 REPLIES 2
Message 2 of 3
orbjeff
in reply to: franco_alamo

Hi Franco,

 

I hope this response isn't too late but I had the same issue and the solution was found in a hotfix Autodesk released after SP1 Update 2 for Vault 2013. Here is the link to the hotfix:

 

http://knowledge.autodesk.com/support/vault-products/downloads/caas/downloads/content/hotfix-file-pr...

Jeff Johnson
Technical Consultant
MasterGraphics Inc.
Message 3 of 3
franco_alamo
in reply to: orbjeff

Hi Jeff,

 

I didn't find a solution and had to use a workaround, so I really appreciate the info. It's also refreshing to hear that is was in fact an issue and not just something I was imagining :). Thanks again for the help.

 

-Franco

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

Post to forums  

Autodesk Design & Make Report