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: 

changing the title of an item

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
tdQ893E
306 Views, 2 Replies

changing the title of an item

tdQ893E
Explorer
Explorer

i need to change the title of existing items using the api. when i try the ItemService.UpdateAndCommitItems command my title stays the same?

setting the item.Title also does nothing

0 Likes

changing the title of an item

i need to change the title of existing items using the api. when i try the ItemService.UpdateAndCommitItems command my title stays the same?

setting the item.Title also does nothing

2 REPLIES 2
Message 2 of 3
Nick_Hall
in reply to: tdQ893E

Nick_Hall
Advocate
Advocate
Accepted solution

Hi

 

This is some code I use to update Item Title & Description - it's in PowerShell, but it's very similar to C# so it should make sense

 

 

$vItem = $vault.ItemService.GetItemsByIds(@( $resultitem.Id ))[0]
$itemRevIds = @($vItem.RevId)
try {
  [Autodesk.Connectivity.WebServices.Item]$vaultItem = $vault.ItemService.EditItems($itemRevIds)[0]
  $vaultItem.Detail = $catalogDescription
  $vaultItem.Title = $catalogTitle
  $vault.ItemService.UpdateAndCommitItems(@($vaultItem))
  Write-Output 'Item Description/Title Update: Success'
} 
catch {
  $vault.ItemService.UndoEditItems(@($vaultItem))
  Write-Output 'Item Description/Title Update: FAILED'
)

 

 

Hope that helps

Nick

Hi

 

This is some code I use to update Item Title & Description - it's in PowerShell, but it's very similar to C# so it should make sense

 

 

$vItem = $vault.ItemService.GetItemsByIds(@( $resultitem.Id ))[0]
$itemRevIds = @($vItem.RevId)
try {
  [Autodesk.Connectivity.WebServices.Item]$vaultItem = $vault.ItemService.EditItems($itemRevIds)[0]
  $vaultItem.Detail = $catalogDescription
  $vaultItem.Title = $catalogTitle
  $vault.ItemService.UpdateAndCommitItems(@($vaultItem))
  Write-Output 'Item Description/Title Update: Success'
} 
catch {
  $vault.ItemService.UndoEditItems(@($vaultItem))
  Write-Output 'Item Description/Title Update: FAILED'
)

 

 

Hope that helps

Nick

Message 3 of 3
tdQ893E
in reply to: Nick_Hall

tdQ893E
Explorer
Explorer
Great this solved my problem, didn't know i had to call edit items into a new item

Thanks
0 Likes

Great this solved my problem, didn't know i had to call edit items into a new item

Thanks

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

Post to forums  

Autodesk Design & Make Report