<?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: Idpair GetLifeCycleStateIdsByFileMasterIds in Vault 2017 in Vault Customization Forum</title>
    <link>https://forums.autodesk.com/t5/vault-customization-forum/idpair-getlifecyclestateidsbyfilemasterids-in-vault-2017/m-p/7242260#M7303</link>
    <description>&lt;P&gt;Please help. This is the code which is throwing error for Vault 2017. I am getting error on the text in red.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public void ChangeState(List&amp;lt;long&amp;gt; selectedMasterFileIds, string projectValue, long releaseState)&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;List&amp;lt;File&amp;gt; updatedFileIds = new List&amp;lt;File&amp;gt;();&lt;BR /&gt;List&amp;lt;long&amp;gt; filesWithNoOrDifferentLifecycle = new List&amp;lt;long&amp;gt;();&lt;BR /&gt;List&amp;lt;long&amp;gt; filesWithBasicLifecycle = new List&amp;lt;long&amp;gt;();&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;IdPair[] states = util.DocSvcExt.GetLifeCycleStateIdsByFileMasterIds(selectedMasterFileIds.ToArray());&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;// IdPair[] states = util.DocSvc.GetFilesByMasterIds(selectedMasterFileIds.ToArray());&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;foreach (IdPair idpair in states)&lt;BR /&gt;{&lt;BR /&gt;if (util.FileLifeCycleStateMap().ContainsKey(idpair.ValId))&lt;BR /&gt;{&lt;BR /&gt;filesWithBasicLifecycle.Add(idpair.EntityId);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;filesWithNoOrDifferentLifecycle.Add(idpair.EntityId);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;long[] lifecycleStateIds = new long[filesWithNoOrDifferentLifecycle.Count];&lt;BR /&gt;long[] lifecycleDefinitionIds = new long[filesWithNoOrDifferentLifecycle.Count];&lt;BR /&gt;File[] newVersions = new File[0];&lt;BR /&gt;File[] moreNewVersions = new File[0];&lt;/P&gt;&lt;P&gt;if (filesWithNoOrDifferentLifecycle.Count &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;#region updating files that don't have a lifecycle definition or have a different one from the basic&lt;/P&gt;&lt;P&gt;for (int z = 0; z &amp;lt; lifecycleStateIds.Length; z++)&lt;BR /&gt;{&lt;BR /&gt;lifecycleStateIds[z] = releaseState;&lt;BR /&gt;lifecycleDefinitionIds[z] = util.FileLifeCycleDefinitionMap()["Exterran Project Design Lifecycle"].Id;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;newVersions = util.DocSvcExt.UpdateFileLifeCycleDefinitions(filesWithNoOrDifferentLifecycle.ToArray(), lifecycleDefinitionIds, lifecycleStateIds, projectValue);&lt;BR /&gt;#endregion&lt;BR /&gt;}&lt;BR /&gt;if (filesWithBasicLifecycle.Count &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;#region updating files that already belong to the basic lifecycle definition or have a different one from the basic&lt;BR /&gt;lifecycleStateIds = new long[filesWithBasicLifecycle.Count];&lt;BR /&gt;for (int z = 0; z &amp;lt; lifecycleStateIds.Length; z++)&lt;BR /&gt;{&lt;BR /&gt;lifecycleStateIds[z] = releaseState;&lt;BR /&gt;}&lt;BR /&gt;moreNewVersions = util.DocSvcExt.UpdateFileLifeCycleStates(filesWithBasicLifecycle.ToArray(), lifecycleStateIds, projectValue);&lt;BR /&gt;#endregion&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;throw new ReleaseWorkflowException("Error changing state." + ex.Message);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2017 14:51:57 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-20T14:51:57Z</dc:date>
    <item>
      <title>Idpair GetLifeCycleStateIdsByFileMasterIds in Vault 2017</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/idpair-getlifecyclestateidsbyfilemasterids-in-vault-2017/m-p/7238578#M7302</link>
      <description>&lt;P&gt;My vault 2014 was using&amp;nbsp;Idpair GetLifeCycleStateIdsByFileMasterIds from&amp;nbsp;&amp;nbsp;Autodesk.Connectivity.WebServices namespace. What is the replacement for Idpair in vault 2017. Please help me with this issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 13:28:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/idpair-getlifecyclestateidsbyfilemasterids-in-vault-2017/m-p/7238578#M7302</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-19T13:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Idpair GetLifeCycleStateIdsByFileMasterIds in Vault 2017</title>
      <link>https://forums.autodesk.com/t5/vault-customization-forum/idpair-getlifecyclestateidsbyfilemasterids-in-vault-2017/m-p/7242260#M7303</link>
      <description>&lt;P&gt;Please help. This is the code which is throwing error for Vault 2017. I am getting error on the text in red.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public void ChangeState(List&amp;lt;long&amp;gt; selectedMasterFileIds, string projectValue, long releaseState)&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;List&amp;lt;File&amp;gt; updatedFileIds = new List&amp;lt;File&amp;gt;();&lt;BR /&gt;List&amp;lt;long&amp;gt; filesWithNoOrDifferentLifecycle = new List&amp;lt;long&amp;gt;();&lt;BR /&gt;List&amp;lt;long&amp;gt; filesWithBasicLifecycle = new List&amp;lt;long&amp;gt;();&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;IdPair[] states = util.DocSvcExt.GetLifeCycleStateIdsByFileMasterIds(selectedMasterFileIds.ToArray());&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;// IdPair[] states = util.DocSvc.GetFilesByMasterIds(selectedMasterFileIds.ToArray());&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;foreach (IdPair idpair in states)&lt;BR /&gt;{&lt;BR /&gt;if (util.FileLifeCycleStateMap().ContainsKey(idpair.ValId))&lt;BR /&gt;{&lt;BR /&gt;filesWithBasicLifecycle.Add(idpair.EntityId);&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;filesWithNoOrDifferentLifecycle.Add(idpair.EntityId);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;long[] lifecycleStateIds = new long[filesWithNoOrDifferentLifecycle.Count];&lt;BR /&gt;long[] lifecycleDefinitionIds = new long[filesWithNoOrDifferentLifecycle.Count];&lt;BR /&gt;File[] newVersions = new File[0];&lt;BR /&gt;File[] moreNewVersions = new File[0];&lt;/P&gt;&lt;P&gt;if (filesWithNoOrDifferentLifecycle.Count &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;#region updating files that don't have a lifecycle definition or have a different one from the basic&lt;/P&gt;&lt;P&gt;for (int z = 0; z &amp;lt; lifecycleStateIds.Length; z++)&lt;BR /&gt;{&lt;BR /&gt;lifecycleStateIds[z] = releaseState;&lt;BR /&gt;lifecycleDefinitionIds[z] = util.FileLifeCycleDefinitionMap()["Exterran Project Design Lifecycle"].Id;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;newVersions = util.DocSvcExt.UpdateFileLifeCycleDefinitions(filesWithNoOrDifferentLifecycle.ToArray(), lifecycleDefinitionIds, lifecycleStateIds, projectValue);&lt;BR /&gt;#endregion&lt;BR /&gt;}&lt;BR /&gt;if (filesWithBasicLifecycle.Count &amp;gt; 0)&lt;BR /&gt;{&lt;BR /&gt;#region updating files that already belong to the basic lifecycle definition or have a different one from the basic&lt;BR /&gt;lifecycleStateIds = new long[filesWithBasicLifecycle.Count];&lt;BR /&gt;for (int z = 0; z &amp;lt; lifecycleStateIds.Length; z++)&lt;BR /&gt;{&lt;BR /&gt;lifecycleStateIds[z] = releaseState;&lt;BR /&gt;}&lt;BR /&gt;moreNewVersions = util.DocSvcExt.UpdateFileLifeCycleStates(filesWithBasicLifecycle.ToArray(), lifecycleStateIds, projectValue);&lt;BR /&gt;#endregion&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;throw new ReleaseWorkflowException("Error changing state." + ex.Message);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 14:51:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vault-customization-forum/idpair-getlifecyclestateidsbyfilemasterids-in-vault-2017/m-p/7242260#M7303</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-20T14:51:57Z</dc:date>
    </item>
  </channel>
</rss>

