<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Browse the versions of an item</title><link>https://www.aras.com/community/f/development/6607/browse-the-versions-of-an-item</link><description>Hi everyone , 
 
 I&amp;#39;m currently trying to implement a C# method that should be able to browse all the versions of a 
 Part Item , 
 thus we can read the states of the different versions and promote them . 
 but the problem is that I don&amp;#39;t know how to</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Browse the versions of an item</title><link>https://www.aras.com/community/thread/10687?ContentTypeID=1</link><pubDate>Mon, 09 Dec 2024 23:41:19 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:3f968a66-e3e7-4049-9a72-2be1e6a8a5e9</guid><dc:creator>Eli Donahue</dc:creator><description>&lt;p&gt;Hi Vinoth,&lt;/p&gt;
&lt;p&gt;I think you&amp;rsquo;re pretty close. Try these two tweaks to the last few lines of your method:&lt;/p&gt;
&lt;pre&gt;&lt;strong&gt;let all_version = inn.newItem(&amp;#39;Part&amp;#39;, &amp;#39;get&amp;#39;);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;all_version.setProperty(&amp;#39;config_id&amp;#39;, config_Id.join(&lt;/strong&gt;&amp;quot;|&amp;quot;&lt;strong&gt;));&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;strong&gt;all_version.setPropertyCondition(&amp;#39;config_id&amp;#39;, &lt;/strong&gt;&lt;strong&gt;&amp;#39;like&amp;#39;&lt;/strong&gt;&lt;strong&gt;);&lt;/strong&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;strong&gt;all_version=all_version.apply();&lt;/strong&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Browse the versions of an item</title><link>https://www.aras.com/community/thread/10679?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2024 12:33:17 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:cad69d3a-68e4-4b78-aef8-f07833f56371</guid><dc:creator>S Vinoth</dc:creator><description>&lt;p&gt;How I can pass multiple Config ID?&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;I tried this way, But is not working for me, Can you please suggest here?&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;br /&gt;let item = inn.newItem(&amp;#39;Part&amp;#39;, &amp;#39;get&amp;#39;);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;item.setProperty(&amp;#39;classification&amp;#39;, &amp;#39;TYPE-A&amp;#39;);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;item.setPropertyCondition(&amp;quot;NAME&amp;quot;, &amp;#39;like&amp;#39;);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;item.setProperty(&amp;quot;NAME&amp;quot;, `%Value_2%`);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;item = item.apply();&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;let config_Id = []&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;for (let i = 0; item.getItemCount() &amp;gt; i; i++) {&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; var current_Item = item.getItemByIndex(i);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; config_Id.push(current_Item.getProperty(&amp;quot;config_id&amp;quot;))&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;let all_version = inn.newItem(&amp;#39;Part&amp;#39;, &amp;#39;get&amp;#39;);&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;all_version.setProperty(&amp;#39;config_id&amp;#39;, config_Id.join(&amp;quot;,&amp;quot;));&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;all_version=all_version.apply();&lt;br /&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div&gt;Thanks&lt;/div&gt;
&lt;div&gt;Vinoth S&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Browse the versions of an item</title><link>https://www.aras.com/community/thread/4028?ContentTypeID=1</link><pubDate>Wed, 27 Nov 2019 14:53:11 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:f12ec597-f8e7-4db3-b727-2fe3124f1c57</guid><dc:creator>Hamdi_Kendil</dc:creator><description>&lt;p&gt;Hi Cogres ,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your response ,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;it was really Helpful ,but just to know , I am using a C# method&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have an other question please ,&lt;/p&gt;
&lt;p&gt;In my code there is a case where I should promote the current Item&amp;nbsp;&lt;/p&gt;
&lt;p&gt;so here is the code I have used :&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;//Obtain the Innovator instance from the Context Item&lt;br /&gt;Innovator inn = this.getInnovator();&lt;/p&gt;
&lt;p&gt;//Get the hexa id of the current EDM Part item&lt;br /&gt;string ID = this.getID();&lt;/p&gt;
&lt;p&gt;//Get the latest Part item with id &amp;quot;ID&amp;quot;&lt;br /&gt;Item latest = inn.getItemById(&amp;quot;Part&amp;quot;,ID);&lt;/p&gt;
&lt;p&gt;//Get the latest Part state&lt;br /&gt;string latestate = latest.getProperty(&amp;quot;state&amp;quot;);&lt;/p&gt;
&lt;p&gt;if(string.Equals(latestate, &amp;quot;serie&amp;quot;, StringComparison.OrdinalIgnoreCase)){&lt;br /&gt; &lt;br /&gt; //get the list of generations of the current Part Item &lt;br /&gt; String config_id = latest.getProperty(&amp;quot;config_id&amp;quot;);&lt;br /&gt; Item allVersions = inn.newItem(&amp;quot;Part&amp;quot;, &amp;quot;get&amp;quot;);&lt;br /&gt; allVersions.setAttribute(&amp;quot;orderBy&amp;quot;, &amp;quot;generation&amp;quot;);&lt;br /&gt; allVersions.setProperty(&amp;quot;config_id&amp;quot;, config_id);&lt;br /&gt; allVersions.setPropertyAttribute(&amp;quot;id&amp;quot;, &amp;quot;condition&amp;quot;, &amp;quot;is not null&amp;quot;);&lt;br /&gt; allVersions = allVersions.apply();&lt;br /&gt; &lt;br /&gt; //get the Item count of the versions &lt;br /&gt; int vercount = allVersions.getItemCount(); &lt;br /&gt; &lt;br /&gt; for(int i=0; i&amp;lt;vercount; i++)&lt;br /&gt; {&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; Item ItemI = allVersions.getItemByIndex(i);&lt;br /&gt; string state = ItemI.getProperty(&amp;quot;state&amp;quot;);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; //string generation = allVersions.getItemByIndex(i).getProperty(&amp;quot;generation&amp;quot;);&lt;br /&gt; if(string.Equals(state, &amp;quot;serie&amp;quot;, StringComparison.OrdinalIgnoreCase))&lt;br /&gt; {&lt;br /&gt; &lt;strong&gt;string NextState = &amp;quot;Auslauf&amp;quot;;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; ItemI.setAction(&amp;quot;promoteItem&amp;quot;);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; ItemI.setProperty(&amp;quot;state&amp;quot;, NextState);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; ItemI = ItemI.apply();&lt;/strong&gt;&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;return latest.apply();&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the code written in Bold Format is what I have used to promote the Item&amp;nbsp;&lt;/p&gt;
&lt;p&gt;is these instructions are Correct ?&amp;nbsp; , or do you have a better method ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;span&gt;Thanks in Advance&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;Hamdi&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Browse the versions of an item</title><link>https://www.aras.com/community/thread/3986?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 13:55:58 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:a3fea212-dc86-471c-81c0-901aab5b13f9</guid><dc:creator>cogres</dc:creator><description>&lt;p&gt;Hi Hamdi,&lt;/p&gt;
&lt;p&gt;in order to get all versions of an item you can query for items with a specific config_id (stable throughout all versions of an item) by specifying the condition &amp;quot;is not null&amp;quot; on the id property.&lt;br /&gt;In AML:&lt;br /&gt;&lt;br /&gt;&amp;lt;Item type=&amp;quot;Part&amp;quot; action=&amp;quot;get&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;id condition=&amp;quot;is not null&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;config_id&amp;gt;configIdOfTheItem&amp;lt;/config_id&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&lt;br /&gt;or using IOM (assuming we have an Innovator object called inn):&lt;br /&gt;&lt;br /&gt;var allVersions = inn.newItem(&amp;quot;Part&amp;quot;, &amp;quot;get&amp;quot;);&lt;br /&gt;allVersions.setProperty(&amp;quot;config_id&amp;quot;, configIdOfItem);&lt;br /&gt;allVersions.setPropertyCondition(&amp;quot;id&amp;quot;, &amp;quot;is not null&amp;quot;);&lt;br /&gt;allVersions = allVersions.apply();&lt;br /&gt;&lt;br /&gt;Hope this helps,&lt;/p&gt;
&lt;p&gt;C&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>