<?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>AML request get where relationship is empty</title><link>https://www.aras.com/community/f/development/3508/aml-request-get-where-relationship-is-empty</link><description>Hi all,

I&amp;#39;m struggling with an AML request, i would like to get items from an Item Type where a certain Relationship is Empty, and an other request  where this Relationship is not empty.

Thank you !

Léo</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: AML request get where relationship is empty</title><link>https://www.aras.com/community/thread/2733?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 07:13:32 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:37c15821-0c02-4d12-9f0a-9c5f3685100f</guid><dc:creator>Bernt Ove Sunde</dc:creator><description>&lt;p&gt;Hi Leo. I`m struggeling with a similar request. Did you get this solution to work for you? If i use the above solution i still get a search that returns no hits when searching for&amp;nbsp;empty&amp;nbsp;relationships.&lt;/p&gt;
&lt;p&gt;One problem i see is that we want to find items that are missing specific relationships, i.e. the relationship is not there. As i see the above logic, it searches on the relationship properties, but this relationship is not there in the first place.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AML request get where relationship is empty</title><link>https://www.aras.com/community/thread/1143?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 03:35:34 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:1d355824-2769-4f9c-93a8-3de23c3ea12e</guid><dc:creator>Former Member</dc:creator><description>Hi Zahar,

Thank you very much for your detailed answer !

Léo&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AML request get where relationship is empty</title><link>https://www.aras.com/community/thread/1142?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 10:56:41 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:d24d4005-3b2f-4609-b7ac-21e76a763c55</guid><dc:creator>Zahar Chernov</dc:creator><description>Leo,

Sorry I have one error in AML (for &amp;quot;To get items with relationships&amp;quot;), you need to add action=&amp;#39;get&amp;#39; to the Part BOM item tag:
&lt;blockquote&gt;
&lt;pre&gt; &amp;lt;AML&amp;gt;
   &amp;lt;Item type=&amp;#39;Part&amp;#39; action=&amp;#39;get&amp;#39;&amp;gt;
     &amp;lt;Relationships&amp;gt;
     &amp;lt;Item type=&amp;#39;Part BOM&amp;#39; &lt;strong&gt;action=&amp;#39;get&amp;#39;&lt;/strong&gt;&amp;gt;
       &amp;lt;related_id condition=&amp;#39;is not null&amp;#39; /&amp;gt;
     &amp;lt;/Item&amp;gt;  
     &amp;lt;/Relationships&amp;gt;
   &amp;lt;/Item&amp;gt;
 &amp;lt;/AML&amp;gt;&lt;/pre&gt;
&lt;/blockquote&gt;
For the second case you can do it using following AML:
&lt;blockquote&gt;
&lt;pre&gt;  &amp;lt;AML&amp;gt;
    &amp;lt;Item type=&amp;#39;Part&amp;#39; action=&amp;#39;get&amp;#39; where=&amp;quot;[Part].id not in (select source_id from Part_BOM)&amp;quot; /&amp;gt;
  &amp;lt;/AML&amp;gt;
&lt;/pre&gt;
Keep in mind that starting Aras 11SP9 where attribute of this type is not secured and in the future version will be obsoleted. Till then if you are using Aras 11SP9 you need to add following XML tag to your InnovatorServerConfig.xml
&lt;pre&gt;&amp;lt;operating_parameter key=&amp;quot;parse_item&amp;quot; value=&amp;quot;false&amp;quot;/&amp;gt;
&lt;/pre&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AML request get where relationship is empty</title><link>https://www.aras.com/community/thread/1139?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 10:19:38 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:2eaece2f-2fff-412d-8622-daa4e9e2150b</guid><dc:creator>Former Member</dc:creator><description>Hi Zahar,

Thank you for your answer, however i haven&amp;#39;t been able to make your AML resquest works as intended,  it always return all the items wheter or not the item&amp;#39;s Relationship is empty or not (is null and is not null yield the same result). Even using your exact code on Part and BOM.
Could you tell me if it works on your end, i havent been able to figure out what&amp;#39;s wrong on my end.

Thank you again !

Léo&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AML request get where relationship is empty</title><link>https://www.aras.com/community/thread/1136?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 04:18:21 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:545e9d11-97d4-4323-80e2-a55aeed14f9f</guid><dc:creator>Zahar Chernov</dc:creator><description>Hello Leo,

If your relationship is related (related_id != null):

To get items &lt;strong&gt;without &lt;/strong&gt;relationships:
&lt;blockquote&gt;
&lt;pre&gt; &amp;lt;AML&amp;gt;
   &amp;lt;Item type=&amp;#39;Part&amp;#39; action=&amp;#39;get&amp;#39;&amp;gt;
     &amp;lt;Relationships&amp;gt;
     &amp;lt;Item type=&amp;#39;Part BOM&amp;#39;&amp;gt;
       &amp;lt;related_id condition=&amp;#39;is null&amp;#39; /&amp;gt;
     &amp;lt;/Item&amp;gt;  
     &amp;lt;/Relationships&amp;gt;
   &amp;lt;/Item&amp;gt;
 &amp;lt;/AML&amp;gt;&lt;/pre&gt;
&lt;/blockquote&gt;
To get items &lt;strong&gt;with&lt;/strong&gt; relationships:
&lt;blockquote&gt;
&lt;pre&gt; &amp;lt;AML&amp;gt;
   &amp;lt;Item type=&amp;#39;Part&amp;#39; action=&amp;#39;get&amp;#39;&amp;gt;
     &amp;lt;Relationships&amp;gt;
     &amp;lt;Item type=&amp;#39;Part BOM&amp;#39;&amp;gt;
       &amp;lt;related_id condition=&amp;#39;is not null&amp;#39; /&amp;gt;
     &amp;lt;/Item&amp;gt;  
     &amp;lt;/Relationships&amp;gt;
   &amp;lt;/Item&amp;gt;
 &amp;lt;/AML&amp;gt;&lt;/pre&gt;
&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>