<?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>Not a single item</title><link>https://www.aras.com/community/f/development/3941/not-a-single-item</link><description>I&amp;#39;m not sure why I keep getting &amp;quot;Not a single item&amp;quot;

Item TDC_BOM = this.newItem(&amp;quot;MIN_Delivered_Component&amp;quot;,&amp;quot;get&amp;quot;);
TDC_BOM.setProperty(&amp;quot;dpas&amp;quot;,&amp;quot;Remove&amp;quot;);
TDC_BOM = TDC_BOM.apply();

List&amp;lt;string&amp;gt; TDCIds = new List&amp;lt;string&amp;gt;();
for (int v=0 ; v&amp;lt;TDC_BOM.getItemCount</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Not a single item</title><link>https://www.aras.com/community/thread/2064?ContentTypeID=1</link><pubDate>Thu, 04 Oct 2018 09:54:18 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:1d984466-11bc-4bb4-9523-2173ceaf4b4f</guid><dc:creator>didonato</dc:creator><description>Chris,

It was another server event on this item type. Thanks!!

&amp;nbsp;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not a single item</title><link>https://www.aras.com/community/thread/2063?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 09:50:44 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:62724395-da52-40e5-9eeb-84767be69634</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

Thank you for the additional code. I&amp;#39;ve tried testing this exact Method in a test environment on my machine, but I wasn&amp;#39;t able to reproduce the &lt;strong&gt;Not a single item&lt;/strong&gt; error that you are seeing. There could be another Server Event on one of these ItemTypes line an &lt;strong&gt;onBefore/onAfterDelete&lt;/strong&gt; that could also be throwing this error.

Could you try adding a debugger to your Method and stepping through the code to see what line is causing that error? You can do this by following the steps below.
&lt;ol&gt;
 	&lt;li&gt;Add the two lines below to the top of your Method
&lt;ul&gt;
 	&lt;li&gt;`System.Diagnostics.Debugger.Launch();
System.Diagnostics.Debugger.Break();`&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
 	&lt;li&gt;Add the following &lt;strong&gt;operating_parameter&lt;/strong&gt; to your InnovatorServerConfig.xml at the root of your code tree
&lt;ul&gt;
 	&lt;li&gt;&lt;code&gt;&amp;lt;operating_parameter key=&amp;quot;DebugServerMethod&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
 	&lt;li&gt;Run the Method as normal&lt;/li&gt;
 	&lt;li&gt;You should be prompted to open Visual Studio which will allow you to step through the execution of the method line by line&lt;/li&gt;
&lt;/ol&gt;
Chris

&lt;hr /&gt;

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not a single item</title><link>https://www.aras.com/community/thread/2062?ContentTypeID=1</link><pubDate>Wed, 03 Oct 2018 09:15:27 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:05f80d8b-7116-4e68-8395-020172ef4245</guid><dc:creator>didonato</dc:creator><description>I&amp;#39;m really struggling with this Chris, Here is my entire method that I&amp;#39;m running from a server event, I also tried to run it directly from the method  (Action/Run Server Method)

&lt;strong&gt;// *** Delete Related ID Components within MIN_Delivered_BOM&lt;/strong&gt;
Item TDC_BOM = this.newItem(&amp;quot;MIN_Delivered_Component&amp;quot;,&amp;quot;get&amp;quot;);
TDC_BOM.setProperty(&amp;quot;dpas&amp;quot;,&amp;quot;Remove&amp;quot;);
TDC_BOM = TDC_BOM.apply();

List&amp;lt;string&amp;gt; TDCIds = new List&amp;lt;string&amp;gt;();
for (int v=0 ; v&amp;lt;TDC_BOM.getItemCount() ; v++){

Item dcBom = this.newItem(&amp;quot;MIN_Delivered_BOM&amp;quot;,&amp;quot;delete&amp;quot;);
dcBom.setAttribute(&amp;quot;where&amp;quot;,&amp;quot;[MIN_Delivered_BOM].related_id = &amp;#39;&amp;quot;+TDC_BOM.getItemByIndex(v).getID()+&amp;quot;&amp;#39;&amp;quot;);
CCO.Utilities.WriteDebug(&amp;quot;deleteRelated&amp;quot;, String.Format(&amp;quot;{0} : DCid&amp;quot;,TDC_BOM.getItemByIndex(v).getID()));
dcBom.apply();
}

&lt;strong&gt;// *** Delete Source ID Components within MIN_Delivered_BOM&lt;/strong&gt;
Item TDC_BOM2 = this.newItem(&amp;quot;MIN_Delivered_Component&amp;quot;,&amp;quot;get&amp;quot;);
TDC_BOM2.setProperty(&amp;quot;dpas&amp;quot;,&amp;quot;Remove&amp;quot;);
TDC_BOM2 = TDC_BOM2.apply();

List&amp;lt;string&amp;gt; TDC2Ids = new List&amp;lt;string&amp;gt;();
for (int u=0 ; u&amp;lt;TDC_BOM2.getItemCount() ; u++){

Item dcBom2 = this.newItem(&amp;quot;MIN_Delivered_BOM&amp;quot;,&amp;quot;delete&amp;quot;);
dcBom2.setAttribute(&amp;quot;where&amp;quot;,&amp;quot;[MIN_Delivered_BOM].source_id = &amp;#39;&amp;quot;+TDC_BOM2.getItemByIndex(u).getID()+&amp;quot;&amp;#39;&amp;quot;);
CCO.Utilities.WriteDebug(&amp;quot;deleteSource&amp;quot;, String.Format(&amp;quot;{0} : DCid&amp;quot;,TDC_BOM2.getItemByIndex(u).getID()));
dcBom2.apply();
}

&lt;strong&gt;// *** Delete the Delivered Component&lt;/strong&gt;
Item dcItem = this.newItem(&amp;quot;MIN_Delivered_Component&amp;quot;,&amp;quot;delete&amp;quot;);
dcItem.setAttribute(&amp;quot;where&amp;quot;,&amp;quot;[MIN_Delivered_Component].dpas = &amp;#39;Remove&amp;#39;&amp;quot;);
dcItem.apply();

return this.getInnovator().newResult(&amp;quot;Delivered Components and its BOM&amp;#39;s have been deleted&amp;quot;);

This is what my data looks like in SQL:

&lt;strong&gt;innovator.MIN_DELIVERED_COMPONENT&lt;/strong&gt;

ID                                                                              DPAS
7D5A81BA1B5B4B3CB5D287F1D60CF034    Remove
5786D96D44234DF39414767D63AED498    Remove
D92E1F0187E34319B170BE1AA6F96D0C     Remove
630BAF3A500E49A9A1AC99CD17E3374C    Remove

&amp;nbsp;

&lt;strong&gt;innovator.MIN_DELIVERED_BOM&lt;/strong&gt;

id                                                                                    RELATED_ID                                                          SOURCE_ID
26B39DDFD3B0493F8EEFBAB445F59C42       5786D96D44234DF39414767D63AED498       7D5A81BA1B5B4B3CB5D287F1D60CF034
2E4484C0412F4FBCBDB5F501E4BC9AA3        630BAF3A500E49A9A1AC99CD17E3374C       7D5A81BA1B5B4B3CB5D287F1D60CF034
5D17CD0BBA8340EFB7B7032F895D3911         D92E1F0187E34319B170BE1AA6F96D0C         5786D96D44234DF39414767D63AED498

&amp;nbsp;

&lt;strong&gt;innovator.MIN_DELIVERED_BOM&lt;/strong&gt;

id                                                                                    SOURCE_ID                                                              RELATED_ID
5D17CD0BBA8340EFB7B7032F895D3911         5786D96D44234DF39414767D63AED498         D92E1F0187E34319B170BE1AA6F96D0C
26B39DDFD3B0493F8EEFBAB445F59C42       7D5A81BA1B5B4B3CB5D287F1D60CF034        5786D96D44234DF39414767D63AED498
2E4484C0412F4FBCBDB5F501E4BC9AA3        7D5A81BA1B5B4B3CB5D287F1D60CF034        630BAF3A500E49A9A1AC99CD17E3374C&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Not a single item</title><link>https://www.aras.com/community/thread/2061?ContentTypeID=1</link><pubDate>Mon, 01 Oct 2018 10:55:23 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:2d28d4ea-adf3-4ff0-87f3-143a49b45a7f</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

From looking at the code, it appears that this method should run correctly. Is this the full code of the method? Is this method intended to be called from an Action or a Server Event?

Chris

&lt;hr /&gt;

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>