Not a single item

I'm not sure why I keep getting "Not a single item" Item TDC_BOM = this.newItem("MIN_Delivered_Component","get"); TDC_BOM.setProperty("dpas","Remove"); TDC_BOM = TDC_BOM.apply(); List<string> TDCIds = new List<string>(); for (int v=0 ; v<TDC_BOM.getItemCount() ; v++){ Item dcBom = this.newItem("MIN_Delivered_BOM","delete"); dcBom.setAttribute("where","[MIN_Delivered_BOM].source_id = '"+TDC_BOM.getItemByIndex(v).getID()+"'"); dcBom.apply(); } return this.getInnovator().newResult("BOM items Deleted");  
Parents
  • Hello, Thank you for the additional code. I've tried testing this exact Method in a test environment on my machine, but I wasn't able to reproduce the Not a single item error that you are seeing. There could be another Server Event on one of these ItemTypes line an onBefore/onAfterDelete 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.
    1. Add the two lines below to the top of your Method
      • `System.Diagnostics.Debugger.Launch(); System.Diagnostics.Debugger.Break();`
    2. Add the following operating_parameter to your InnovatorServerConfig.xml at the root of your code tree
      • <operating_parameter key="DebugServerMethod" value="true"/>
    3. Run the Method as normal
    4. You should be prompted to open Visual Studio which will allow you to step through the execution of the method line by line
    Chris
    Christopher Gillis Aras Labs Software Engineer
Reply
  • Hello, Thank you for the additional code. I've tried testing this exact Method in a test environment on my machine, but I wasn't able to reproduce the Not a single item error that you are seeing. There could be another Server Event on one of these ItemTypes line an onBefore/onAfterDelete 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.
    1. Add the two lines below to the top of your Method
      • `System.Diagnostics.Debugger.Launch(); System.Diagnostics.Debugger.Break();`
    2. Add the following operating_parameter to your InnovatorServerConfig.xml at the root of your code tree
      • <operating_parameter key="DebugServerMethod" value="true"/>
    3. Run the Method as normal
    4. You should be prompted to open Visual Studio which will allow you to step through the execution of the method line by line
    Chris
    Christopher Gillis Aras Labs Software Engineer
Children
No Data