<?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>What is the best way to validate whether an item has a parent?</title><link>https://www.aras.com/community/f/development/36744/what-is-the-best-way-to-validate-whether-an-item-has-a-parent</link><description>I&amp;#39;m trying to send an email on promotion to &amp;quot;Released&amp;quot; of Parts when a couple of criteria are met, the parts being of a certain custom classification we&amp;#39;ve added, and them not being used in another BOM anywhere (i.e. they&amp;#39;re top-level Parts being released</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: What is the best way to validate whether an item has a parent?</title><link>https://www.aras.com/community/thread/7169?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 13:36:16 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:ca8771e0-6f4f-4cb4-805b-271d98ee88be</guid><dc:creator>Kai Kircher</dc:creator><description>&lt;p&gt;That did the trick! Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the best way to validate whether an item has a parent?</title><link>https://www.aras.com/community/thread/7166?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 07:30:11 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:7698375f-23ed-4a96-b5d3-92f0d4c06c58</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;Hi Kai Kircher&lt;/p&gt;
&lt;p&gt;Easiest way to check whether the item is top level item or not, you can use below code&lt;/p&gt;
&lt;p&gt;Innovator inn = this.getInnovator();&lt;br /&gt;Item myResult;&lt;br /&gt;if (this.getProperty(&amp;quot;classification&amp;quot;, &amp;quot;&amp;quot;) == &amp;quot;Hull Assembly&amp;quot;)&lt;br /&gt;{&lt;br /&gt; Item checkIsRoot = this.newItem(&amp;quot;Part BOM&amp;quot;,&amp;quot;get&amp;quot;);&lt;br /&gt; checkIsRoot.setAttribute(&amp;quot;select&amp;quot;,&amp;quot;id&amp;quot;);&lt;br /&gt; checkIsRoot.setAttribute(&amp;quot;maxRecords&amp;quot;,&amp;quot;1&amp;quot;);&lt;br /&gt; checkIsRoot.setProperty(&amp;quot;related_id&amp;quot;,this.getID());&lt;br /&gt; checkIsRoot = checkIsRoot.apply();&lt;br /&gt; if(checkIsRoot.isError())&lt;br /&gt; {&lt;br /&gt; //email code&lt;br /&gt; }&lt;br /&gt; else&lt;br /&gt; {&lt;br /&gt; // This item has been used in some Part as BOM&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;return this;&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>