<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Edit Item, Update Properties in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3205656#M12337</link>
    <description>&lt;PRE&gt;System.Web.Services.Protocols.SoapException was unhandled
  Actor="http://config-mgmt-srv/AutodeskDM/Services/ItemService.asmx"
  Lang=""
  Message="1387"
  Node="http://config-mgmt-srv/AutodeskDM/Services/ItemService.asmx"
  Role=""
  Source="System.Web.Services"
  StackTrace:
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Vault.ItemService.ItemService.EditItem(Int64 itemRevisionId) in C:\Documents and Settings\mspears\My Documents\Visual Studio 2005\Projects\Vault\Vault\Web References\ItemService\Reference.vb:line 2331
       at Vault.Explorer1.editItem(Object SelectedItem) in C:\Documents and Settings\mspears\My Documents\Visual Studio 2005\Projects\Vault\Vault\Explorer1.vb:line 210
       at Vault.Explorer1.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\mspears\My Documents\Visual Studio 2005\Projects\Vault\Vault\Explorer1.vb:line 199
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at Vault.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This is the only Stack Trace I get, and the only error code is 1387, I don't see a restriction code?&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2011 15:06:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-10-26T15:06:33Z</dc:date>
    <item>
      <title>Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3204536#M12335</link>
      <description>&lt;P&gt;I am trying to edit a item and set a new unit of measure and then UpdateAndCommitItem() to save changes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Private Function editItem(ByVal SelectedItem)

        Dim items As Item() = ItemSvc.GetAllLatestItems()

        For Each item As Item In items
             Dim eitem As New ItemService.Item
             eitem = ItemSvc.EditItem(item.RevId)&lt;BR /&gt;             eitem.Units = "FT"        &lt;BR /&gt;        Next
        Return True
    End Function&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I am getting error 1387 while doing &lt;EM&gt;eitem = ItemSvc.EditItem(item.RevId)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;... but I assume if that would work I'd just do eitem.Units = "FT" followed by a UpdateAndCommitItem() and I am not sure on the parameters I'd have to input... just the properties I'm updating?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Oct 2011 20:16:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3204536#M12335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-25T20:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3205406#M12336</link>
      <description>&lt;P&gt;Correct, setting the Units property on the object and calling a Commit function is how you change the units.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I recommend calling UpdateAndCommitItems whenever possible.&amp;nbsp; It's much easier to work with than the function without the 's' at the end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, your failure is at EditItem, so you need to find out what that error means.&amp;nbsp; When you get one of the RestrictionsOccurred errors, you need to find the &lt;EM&gt;real&lt;/EM&gt; reason by digging into the XML data on the SoapException.&amp;nbsp; See the Restriction Codes page for more information on how to parse the XML.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2011 13:22:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3205406#M12336</guid>
      <dc:creator>Redmond.D</dc:creator>
      <dc:date>2011-10-26T13:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3205656#M12337</link>
      <description>&lt;PRE&gt;System.Web.Services.Protocols.SoapException was unhandled
  Actor="http://config-mgmt-srv/AutodeskDM/Services/ItemService.asmx"
  Lang=""
  Message="1387"
  Node="http://config-mgmt-srv/AutodeskDM/Services/ItemService.asmx"
  Role=""
  Source="System.Web.Services"
  StackTrace:
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Vault.ItemService.ItemService.EditItem(Int64 itemRevisionId) in C:\Documents and Settings\mspears\My Documents\Visual Studio 2005\Projects\Vault\Vault\Web References\ItemService\Reference.vb:line 2331
       at Vault.Explorer1.editItem(Object SelectedItem) in C:\Documents and Settings\mspears\My Documents\Visual Studio 2005\Projects\Vault\Vault\Explorer1.vb:line 210
       at Vault.Explorer1.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\mspears\My Documents\Visual Studio 2005\Projects\Vault\Vault\Explorer1.vb:line 199
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.ButtonBase.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.Button.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at Vault.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This is the only Stack Trace I get, and the only error code is 1387, I don't see a restriction code?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2011 15:06:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3205656#M12337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-26T15:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3206988#M12338</link>
      <description>&lt;P&gt;The stack trace doen't have the restriction codes.&amp;nbsp; You need to cast the Exception to type System.Web.Services.Protocols.SoapException and look in the Detail property.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 13:15:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3206988#M12338</guid>
      <dc:creator>Redmond.D</dc:creator>
      <dc:date>2011-10-27T13:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3207182#M12339</link>
      <description>&lt;P&gt;Could you please show me how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate it!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 14:36:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3207182#M12339</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-10-27T14:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3207614#M12340</link>
      <description>&lt;P&gt;I don't have any code handy for getting at the restriction codes.&amp;nbsp; However I have an article that explains &lt;A href="http://justonesandzeros.typepad.com/blog/2009/11/errors-and-restrictions.html" target="_self"&gt;how to get the error code&lt;/A&gt;.&amp;nbsp; The code has an example of how to cast the Exception to a SoapException.&amp;nbsp; Once you have the SoapException object, copy the Detail value and post it so that I can take a look.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2011 18:36:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3207614#M12340</guid>
      <dc:creator>Redmond.D</dc:creator>
      <dc:date>2011-10-27T18:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3212716#M12341</link>
      <description>&lt;P&gt;I figured out the restrictions, thank you for your help... I am having trouble using UpdateAndCommitItems(). I understand it takes the following properties to update and commit items:&lt;/P&gt;&lt;PRE&gt;&amp;lt;ns:UpdateAndCommitItems&amp;gt;
         &amp;lt;ns:itemRevisions&amp;gt;
            &amp;lt;ns:Item RevId="?" RevNum="?" LastModUserName="?" LastModUserId="?" LastModDate="?" MasterId="?" ItemNum="?" ItemTypId="?" Title="?" Detail="?" Id="?" VerNum="?" Comm="?" Units="?" LfCycStateId="?" UnitId="?" NumSchmId="?" CadBOMStructId="?" ControlledByChangeOrder="?" EffStart="?" EffEnd="?"/&amp;gt;
         &amp;lt;/ns:itemRevisions&amp;gt;
      &amp;lt;/ns:UpdateAndCommitItems&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I am able to edit the item, but when I try to commit:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Dim eitem As New ItemService.Item
                    eitem = ItemSvc.EditItem(item.RevId)
                    eitem.Units = "Liquid Ounce"

                    ItemSvc.UpdateAndCommitItems(eitem)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Doesn't work, says it's a one-dimensional array, so I might have to combine a string with all those properties?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2011 17:25:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3212716#M12341</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-01T17:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3215356#M12342</link>
      <description>&lt;P&gt;Ok, got past that part with this code:&lt;/P&gt;&lt;PRE&gt; Try
            Dim items As Item() = ItemSvc.GetAllLatestItems()

            For Each item As Item In items
                If item.ItemNum = SelectedItem Then
                    Dim eitem As New Vault.ItemService.Item
                    eitem = ItemSvc.EditItem(item.RevId)
                    eitem.Units = "Liquid Ounce"
                    eitem.UnitId = 16

                    ItemSvc.UpdateAndCommitItems(New Item() {eitem})
                    MsgBox("Updated")
                End If
            Next
            Return True
        Catch E As System.Web.Services.Protocols.SoapException
            MessageBox.Show(E.Detail("sl:sldetail").InnerText)
        End Try&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;All seems to go good, but it doesn't actually update the item with the new unit of measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2011 13:22:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3215356#M12342</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-11-03T13:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Edit Item, Update Properties</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3216204#M12343</link>
      <description>&lt;P&gt;That code looks correct to me.&amp;nbsp; Are you sure that UpdateAndCommitItems is actually being called?&amp;nbsp; Maybe the if statement is weeding out all the items.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you don't need to update the Units property.&amp;nbsp; Updating UnitId should be sufficient.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2011 19:07:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/edit-item-update-properties/m-p/3216204#M12343</guid>
      <dc:creator>Redmond.D</dc:creator>
      <dc:date>2011-11-03T19:07:33Z</dc:date>
    </item>
  </channel>
</rss>

