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?
Solved! Go to Solution.
Solved by gluckett. Go to Solution.
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, 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...
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)