<?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>How to get relationship ITEM linked to latest released source ITEM in AML</title><link>https://www.aras.com/community/f/development/37159/how-to-get-relationship-item-linked-to-latest-released-source-item-in-aml</link><description>hello, 
 The datamodel is simple : 2 ITEM type = &amp;quot;itmSource&amp;quot; and &amp;quot; tmRelated&amp;quot; Both are versionnable and with lifecycle The last state of lifecycle allows to set is_released to &amp;quot;1&amp;quot; on itmSource 1 relation &amp;quot;Relation&amp;quot; between itmSource and itmRelated 
 Question</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to get relationship ITEM linked to latest released source ITEM in AML</title><link>https://www.aras.com/community/thread/8031?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 15:45:37 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:1c3caa58-ec57-44c6-bfe4-cb45ac0dea0f</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If this is the case, below query will give the Relation1, 2 and 3&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;AML&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Relation&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;source_id&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;itmSource&amp;quot;&amp;nbsp; where=&amp;quot;[itmSource].is_released =&amp;#39;1&amp;#39; AND [itmSource].is_current =&amp;#39;0&amp;#39;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;/Item&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;/source_id&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;/Item&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&amp;lt;/AML&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However, if you want only Relation 3 then try with below&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;AML&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Relation&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;source_id&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;itmSource&amp;quot; where=&amp;quot;[itmSource].is_released =&amp;#39;1&amp;#39;&amp;quot; orderBy=&amp;quot;generation DESC&amp;quot; maxRecords=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;generation condition=&amp;quot;gt&amp;quot;&amp;gt;0&amp;lt;/generation&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/source_id&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/AML&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get relationship ITEM linked to latest released source ITEM in AML</title><link>https://www.aras.com/community/thread/8023?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 13:36:16 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:04c5a4b9-37e1-4501-a937-7edc3871483b</guid><dc:creator>Francois Breton</dc:creator><description>&lt;p&gt;hello, my context is like that&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- itmSource1 (generation = 1, Is_released = 1, is_current = 0) linked to Relation 1&lt;/span&gt;&lt;br /&gt;&lt;span&gt;- itmSource1 (generation = 2, Is_released = 1, is_current = 0) linked to Relation 2&lt;/span&gt;&lt;br /&gt;&lt;span&gt;- itmSource1 (generation = 3, Is_released = 1, is_current = 0) linked to Relation 3&lt;/span&gt;&lt;br /&gt;&lt;span&gt;- itmSource1 (generation = 4, Is_released = 0, is_current = 1) linked to Relation 4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Because I &amp;quot;validate&amp;quot; my ITEM each time before revising.&lt;br /&gt;So you have&amp;nbsp;Is_released = 1 severla time&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get relationship ITEM linked to latest released source ITEM in AML</title><link>https://www.aras.com/community/thread/8022?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 13:18:24 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:ef8813be-8c15-4b61-94f9-658fd357be72</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;Assuming below example:&lt;/p&gt;
&lt;p&gt;- itmSource1 (generation = 1, Is_released = 0, is_current = 0) linked to Relation 1&lt;br /&gt;- itmSource1 (generation = 2, Is_released = 0, is_current = 0) linked to Relation 2&lt;br /&gt;- itmSource1 (generation = 3, Is_released = 1, is_current = 0) linked to Relation 3&lt;br /&gt;- itmSource1 (generation = 4, Is_released = 0, is_current = 1) linked to Relation 4&lt;/p&gt;
&lt;p&gt;Below Query Output is Relation 3&lt;br /&gt;&amp;lt;AML&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Part BOM&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;source_id&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Part&amp;quot; orderBy=&amp;quot;generation&amp;quot; where=&amp;quot;[Part].is_released =&amp;#39;1&amp;#39; AND is_current =&amp;#39;0&amp;#39;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/source_id&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/AML&amp;gt;&lt;/p&gt;
&lt;p&gt;Below Query Output is Relation 4&lt;br /&gt;&amp;lt;AML&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Part BOM&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;source_id&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Part&amp;quot; orderBy=&amp;quot;generation&amp;quot; where=&amp;quot;[Part].is_released =&amp;#39;0&amp;#39; AND is_current =&amp;#39;1&amp;#39;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/source_id&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/AML&amp;gt;&lt;/p&gt;
&lt;p&gt;Below Query Output is Relation 1 and Relation 2&lt;br /&gt;&amp;lt;AML&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Part BOM&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;source_id&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Part&amp;quot; orderBy=&amp;quot;generation&amp;quot; where=&amp;quot;[Part].is_released =&amp;#39;0&amp;#39; AND is_current =&amp;#39;0&amp;#39;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/source_id&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/AML&amp;gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get relationship ITEM linked to latest released source ITEM in AML</title><link>https://www.aras.com/community/thread/8021?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 13:09:50 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:404c2885-da9b-4b5c-a5c9-ee227498101f</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;Hi Breton&lt;/p&gt;
&lt;p&gt;Assuming below example: When you use only is_released = &amp;quot;1&amp;quot;, it is always pointing to&amp;nbsp;&lt;strong&gt;itmSource1&lt;/strong&gt; in the query&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;- itmSource1 (generation=1, Is_released=1, is_current=0 ) linked to&amp;nbsp;Relation1 &lt;/strong&gt;and you would like to retrieve Relation1 of this&lt;/p&gt;
&lt;p&gt;&amp;lt;AML&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;&lt;span&gt;Relation&lt;/span&gt;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;source_id&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;&lt;span&gt;itmSource&lt;/span&gt;&amp;quot; where=&amp;quot;[&lt;span&gt;itmSource&lt;/span&gt;].is_released =&amp;#39;1&amp;#39;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/source_id&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/AML&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Output of this query is&amp;nbsp;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Relationship that connects&amp;nbsp;itmSource in Released State or In Change State as source item and&amp;nbsp;tmRelated as related item&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get relationship ITEM linked to latest released source ITEM in AML</title><link>https://www.aras.com/community/thread/8019?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 10:57:12 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:e10579e1-490e-4b1f-838b-5b1d65004d5b</guid><dc:creator>Francois Breton</dc:creator><description>&lt;p&gt;Hello, Thanks for your answer but the AML respond is not compliant to the need :&lt;br /&gt;why :&lt;br /&gt;&lt;br /&gt;If you have&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;- itmSource1 (generation=1, Is_released=1, is_current=0 ) linked to&amp;nbsp;Relation1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;- itmSource2 (generation=2, Is_released=0, is_current=1 ) linked to&amp;nbsp;Relation2&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Regarding the example, I would like to retrieve&amp;nbsp;Relation1 (linked to itmSource1&amp;nbsp;at Is_released=1).&lt;br /&gt;But&amp;nbsp;&amp;nbsp;is_current=0 because is not the latest generation&lt;br /&gt;&lt;br /&gt;Normlaly, you can filter it by using&amp;nbsp;queryType=&amp;quot;Released&amp;quot;, but not in sub AML request..(except I made an error) :-)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to get relationship ITEM linked to latest released source ITEM in AML</title><link>https://www.aras.com/community/thread/8016?ContentTypeID=1</link><pubDate>Mon, 14 Feb 2022 09:27:05 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:90280d19-2f65-4938-baa9-38d3e2d10f77</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;&lt;strong&gt;Hi Breton&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It depends on the situation. If you want only the latest released item based on the Relation then use below query&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Output of below query will be all the itemSource which is released and latest&lt;/p&gt;
&lt;p&gt;&amp;lt;AML&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;Relation&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;source_id&amp;gt;&lt;br /&gt;&amp;lt;Item action=&amp;quot;get&amp;quot; type=&amp;quot;itmSource&amp;quot; where=&amp;quot;[&lt;span&gt;itmSource&lt;/span&gt;].is_released = &amp;#39;1&amp;#39; AND [&lt;span&gt;itmSource&lt;/span&gt;].is_current = &amp;#39;1&amp;#39;&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/source_id&amp;gt;&lt;br /&gt;&amp;lt;/Item&amp;gt;&lt;br /&gt;&amp;lt;/AML&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank You&lt;/p&gt;
&lt;p&gt;Gopikrishnan R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>