Hey,
any one can help me please
how i can change the Category of a item
i finde only the file change with
and change category from a folder
so how i do it for a Item
thx for help or sugesstions
Mario
Vault Pro 2015
VB or c# pls
Solved! Go to Solution.
Solved by wayne.brill. Go to Solution.
Hi Mario,
I used Fiddler and I see UpdateAndCommitItem() being called when I change the category of an item using Vault Explorer.
http://justonesandzeros.typepad.com/blog/2012/03/fiddling-with-the-vault-api.html
I tested using UpdateAndCommitItem() to change the ItemTypId property of the item in this SDK example:
C:\Program Files (x86)\Autodesk\Autodesk Vault 2014 SDK\VS10\VB\ItemEditor
I added a button to the MainForm and added the following code. It is changing the category of the selected item in my tests.
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim myItem As Item = Nothing
Try
' Using this to get the category to change the Item to
' On the form select the dropdown for the Type (category).
' Not using the Title so just leave it blank and hit ok
Dim form As New CreateItemForm(m_connection)
form.ShowDialog()
If form.DialogResult <> DialogResult.OK Then
Return
End If
' Get the latest item
Dim itemRev As Item = m_connection.WebServiceManager.ItemService.GetLatestItemByItemNumber(m_selectedItem.ItemNum)
'Edit the item
myItem = m_connection.WebServiceManager.ItemService.EditItem(itemRev.RevId)
'Change the category of the item
myItem.ItemTypId = form.Category.Id
'commit
m_connection.WebServiceManager.ItemService.UpdateAndCommitItem(myItem, _
0,
False, Nothing, Nothing, _
Nothing, Nothing, Nothing, _
Nothing, 2)
Catch ex As Exception
If Not myItem Is Nothing Then
m_connection.WebServiceManager.ItemService.UndoEditItems(
New Long() {myItem.Id})
End If
MessageBox.Show("Error occurred " + ex.ToString())
End Try
End Sub
Please let me know if this does not provide a solution.
Thanks,
Wayne