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
Solved! Go to Solution.
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
Solved! Go to Solution.
Solved by Nick_Hall. Go to 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
Can't find what you're looking for? Ask the community or share your knowledge.