<?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: Get Id of Release State in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3786118#M11344</link>
    <description>&lt;P&gt;Are there any more details you can give on the failure, such as the error code?&lt;/P&gt;
&lt;P&gt;Here is some &lt;A href="http://justonesandzeros.typepad.com/blog/2011/11/getting-the-restriction-codes.html" target="_self"&gt;code for extracting the error and restriction codes&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Feb 2013 13:02:11 GMT</pubDate>
    <dc:creator>Redmond.D</dc:creator>
    <dc:date>2013-02-21T13:02:11Z</dc:date>
    <item>
      <title>Get Id of Release State</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3784838#M11340</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for the "Released State" id for a particular lifecycle definition, but I'm lost.&lt;/P&gt;&lt;P&gt;Who can point me to the right direction?&lt;/P&gt;&lt;P&gt;The code I use is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim LfCycDefs = serviceManager.DocumentServiceExtensions.GetAllLifeCycleDefinitions&lt;BR /&gt;&lt;SPAN style="line-height: 14px;"&gt;Dim ReleaseProcessID = LfCycDefs.FirstOrDefault(Function(states) states.SysName = "My Release Process")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 14px;"&gt;Dim ReleaseId As Long&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; For Each StateID In ReleaseProcessID.StateArray&lt;BR /&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp; &amp;nbsp; If StateID.DispName = "Released" Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp; &amp;nbsp;ReleaseId = StateID.Id&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 14px;"&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;Next&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2013 11:12:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3784838#M11340</guid>
      <dc:creator>blokmech</dc:creator>
      <dc:date>2013-02-20T11:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Get Id of Release State</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3784924#M11341</link>
      <description>&lt;P&gt;It looks like you are confusing &lt;A href="http://justonesandzeros.typepad.com/blog/2012/04/system-name-vs-display-name.html" target="_self"&gt;system name and display name&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find your lifecycle definition you need to run the following comparison:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="line-height: 14px;"&gt;states.&lt;STRONG&gt;DispName&lt;/STRONG&gt; = "My Release Process"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2013 13:12:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3784924#M11341</guid>
      <dc:creator>Redmond.D</dc:creator>
      <dc:date>2013-02-20T13:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get Id of Release State</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3784947#M11342</link>
      <description>&lt;P&gt;Doug,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are correct, but I think I'm very close to the solution what i want, but still it's not working. It fails on the line starting with "&lt;SPAN&gt;&amp;nbsp;docsvcExt.UpdateFileLifeCycleStates&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;I also changed the method of getting the Id(I know it is not the most fine solution...):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim LfCycDefs = serviceManager.DocumentServiceExtensions.GetAllLifeCycleDefinitions&lt;BR /&gt;Dim LifeCycleId As Long&lt;BR /&gt;&amp;nbsp; For Each LfCycle In LfCycDefs&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If LfCycle.DispName = "My Release Process" Then&lt;BR /&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp; &amp;nbsp; LifeCycleId = LfCycle.Id&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; End If&lt;BR /&gt;&amp;nbsp; Next&lt;BR /&gt;&lt;BR /&gt;'Get LifeCylceStateID of "Released"&lt;BR /&gt;Dim FileStates = ServiceManager.DocumentServiceExtensions.GetLatestRevisionLifeCycleStatesByDefinitionId(LifeCycleId)&lt;BR /&gt;Dim ReleaseId() As Long&lt;BR /&gt;&amp;nbsp; For Each StateID In FileStates&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If StateID.DispName = "Released" Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ReleaseId = New Long() {StateID.Id}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; End If&lt;BR /&gt;&amp;nbsp; Next&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim docsvcExt As New Autodesk.Connectivity.WebServices.DocumentServiceExtensions&lt;/P&gt;&lt;P&gt;Dim PDFs As Autodesk.Connectivity.WebServices.File() = serviceManager.DocumentService.GetLatestFilesByFolderId(FolderPDFId1, False)&lt;BR /&gt;&amp;nbsp; For Each pdf As Autodesk.Connectivity.WebServices.File In PDFs&lt;BR /&gt;&amp;nbsp; &amp;nbsp; If pdf.FileLfCyc.LfCycStateName = "Work in Progress" Then&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim pdfmasterid() As Long = New Long() {pdf.MasterId}&lt;BR /&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp; &amp;nbsp;docsvcExt.UpdateFileLifeCycleStates(New Long() {pdfmasterid(0)}, New Long() {ReleaseId(0)}, "Released for Purchase Department")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="line-height: 14px;"&gt;&amp;nbsp; &amp;nbsp; End If&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; Next&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2013 13:35:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3784947#M11342</guid>
      <dc:creator>blokmech</dc:creator>
      <dc:date>2013-02-20T13:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get Id of Release State</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3786039#M11343</link>
      <description>&lt;P&gt;Anyone?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2013 11:39:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3786039#M11343</guid>
      <dc:creator>blokmech</dc:creator>
      <dc:date>2013-02-21T11:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get Id of Release State</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3786118#M11344</link>
      <description>&lt;P&gt;Are there any more details you can give on the failure, such as the error code?&lt;/P&gt;
&lt;P&gt;Here is some &lt;A href="http://justonesandzeros.typepad.com/blog/2011/11/getting-the-restriction-codes.html" target="_self"&gt;code for extracting the error and restriction codes&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2013 13:02:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/get-id-of-release-state/m-p/3786118#M11344</guid>
      <dc:creator>Redmond.D</dc:creator>
      <dc:date>2013-02-21T13:02:11Z</dc:date>
    </item>
  </channel>
</rss>

