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: 

Edit of unmapped UDP (File Property)

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
gluckett
887 Views, 6 Replies

Edit of unmapped UDP (File Property)

HI All,

I have a UDP on a file that is currently blank.  I know its ID (84) and have the file's MasterId.

 

Example:

 

 

serviceManager.DocumentService.UpdateFileProperties(New Long() {file.MasterId}, New Long() {84}, New String() {"My Custom Property Is now populated"})

 

Do I need to send my String in a different way?  Perhaps as an Object?

 

 

 

 

6 REPLIES 6
Message 2 of 7
Redmond.D
in reply to: gluckett

The code looks OK to me, but I'm guessing it's not working for you.  Can you describe the problem more?  Are you getting an error?  If so, what is the error code?



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 7
gluckett
in reply to: Redmond.D

Doug, yes here is a bigger snippet of the code, I can update the Category but not the UDP

 


            For Each file As Autodesk.Connectivity.WebServices.File In files
               If parentFolder.FullName = "$/MYTESTFOLDER" Then


                    'Setting the File Category works great...                  
                    serviceManager.DocumentServiceExtensions.UpdateFileCategories(New Long() {file.MasterId}, New Long() {"37"}, "")

                    'This fails...
                    serviceManager.DocumentService.UpdateFileProperties(New Long() {file.MasterId}, New Long() {"84"}, New String() {"My Update"})

                End If

            Next

 

The error on the UpdateFileProperties is "SoapException: 1136" - I don't get any errors when updating Categories...

 

 

 

 

 

Message 4 of 7
minkd
in reply to: gluckett

In order to update properties the file must be checked-out first.

 

-Dave



Dave Mink
Fusion Lifecycle
Autodesk, Inc.
Message 5 of 7
gluckett
in reply to: minkd

That did the trick!  I checked out, changed the UDP and checked in.

 

 

  Dim out As ByteArray
 serviceManager.DocumentService.CheckoutFile(parentFolder.Id, file.Id,
                               CheckoutFileOptions.Master,
                               Environment.MachineName,
                               "c:\temp\", "",
                           DownloadOptions.Download,
                                    False, out)

 

 serviceManager.DocumentService.UpdateFileProperties(New Long() {file.MasterId}, New Long() {"84"}, New String() {"My Update"})

 


serviceManager.DocumentService.CheckinFile(file.MasterId, "", False, Today, Nothing, Nothing, True, file.Name, file.FileClass, file.Hidden, out)

 

 

 

 

Message 6 of 7
spascual
in reply to: gluckett

Hi Sirs,
Anybody knows if for vault 2022 same process works?
Thanks,
Message 7 of 7
gluckett
in reply to: spascual

Haven't tried with 2022, but the API hasn't changed that much...

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

Post to forums  

Autodesk Design & Make Report