<?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>Delete item from BOM</title><link>https://www.aras.com/community/f/development/3299/delete-item-from-bom</link><description>Hi,

 

I created a new method that transfers a item from one BOM to another. The adding to a new BOM works fine, its the deleting from the old BOM is where I&amp;#39;m having a problem. I&amp;#39;m getting &amp;quot;Aras.Server.Core.MissingCriteriaException&amp;quot; error. &amp;#160;with the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Delete item from BOM</title><link>https://www.aras.com/community/thread/533?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2017 07:44:47 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:f146f01d-32e2-4492-a030-e6c448c2a5f9</guid><dc:creator>didonato</dc:creator><description>THANKS Yoann!!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Delete item from BOM</title><link>https://www.aras.com/community/thread/534?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2017 13:51:27 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:4b1b6f51-8aa6-4e76-913b-731cec49834b</guid><dc:creator>Yoann Maingon</dc:creator><description>Hi Dominic,

Delete and Update actions require either an ID as attribute or a where clause.

I&amp;#39;m not checking the whole code, but for the specific error you see, you should rewrite the deletion part with the following:
&lt;pre&gt;Item deleteComponentBom = this.newItem(“MIN_System_BOM”,”delete”);
deleteComponentBom.setAttribute(“where”,&amp;quot;[MIN_System_BOM].related_id = &amp;#39;&amp;quot;+TDC_BOM.getItemByIndex(j).getRelatedItemID()+&amp;quot;&amp;#39;&amp;quot;);
deleteComponentBom.apply();


&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>