How to Delete Release using a Custom Action

The code did work on my last test case. But Now that I am trying another case, I get an error that I can’t trace for the life of me!

In this test case I am adding two releases to a new line on a closed order. First I reopen the order with the BO, then I use the same process I had before to add the new lines and update the releases. I tried to run a trace to see if I could glean any extra information. How do I tell what line of code this error is referencing? I went through each of my custom code elements and added junk code to see if I could get the line number to change, maybe to help point me towards the right section, but no matter what I added or removed the line is always 73 and column is 17.

When I run now I get this error:

Business Layer Exception

The table queryResultDataset.Results has more than one record

Exception caught in: Epicor.ServiceModel

Error Detail

Description: The table queryResultDataset.Results has more than one record
Program: Epicor.Customization.BPM.dll
Method: GetSingleRow
Line Number: 73
Column Number: 17
Table: queryResultDataset.Results

Client Stack Trace

at Epicor.ServiceModel.Channels.ImplBase1.ShouldRethrowNonRetryableException(Exception ex, DataSet[] dataSets) at Ice.Proxy.BO.DynamicQueryImpl.RunCustomAction(DynamicQueryDataSet queryDS, String actionID, DataSet queryResultDataset) at Ice.Adapters.DynamicQueryAdapter.<>c__DisplayClass33_0.<RunCustomAction>b__0(DataSet datasetToSend) at Ice.Adapters.DynamicQueryAdapter.ProcessUbaqMethod(String methodName, DataSet updatedDS, Func2 methodExecutor, Boolean refreshQueryResultsDataset)
at Ice.Adapters.DynamicQueryAdapter.RunCustomAction(DynamicQueryDataSet queryDS, String actionId, DataSet updatedDS, Boolean refreshQueryResultsDataset)
at Ice.UI.App.BAQDesignerEntry.BAQTransaction.<>c__DisplayClass384_0.b__0(Int32& rowReturned)
at Ice.UI.App.BAQDesignerEntry.Forms.BAQDiagramForm.ShowQueryResults(DataSet dsResults, getQueryResult getResults, ReportAdditionalInfo additionalInfo)
at Ice.UI.App.BAQDesignerEntry.BAQTransaction.CallRunCustom()

Here are the three custom code elements I have in place now, and an image of my process.
PullInData

var ttResults_xRow = (from ttResults_Row in ttResults where ttResults_Row.Calculated_NewRelease == true select ttResults_Row).First();
if (ttResults_xRow != null)
{
  IsNewLine=false;
  totalrows = ttResults.Count / 2; //not sure why this is divided by 2, but it works...
  if (myrow <= totalrows)
    {
        MyOrder = ttResults_xRow.OrderHed2_OrderNum;
        if (String.IsNullOrEmpty(Convert.ToString(ttResults_xRow.OrderDtl1_OrderLine)))
        {
          MyLine = 0;
        }
        else
        {
          MyLine = ttResults_xRow.OrderDtl1_OrderLine;
        }
        MyQty = ttResults_xRow.UD02_Number01;
        MyDate = ttResults_xRow.UD02_Date01;
        MyPart = ttResults_xRow.UD02_ShortChar01;
        ttResults_xRow.Calculated_NewRelease = false;
    }
}

SetMyLine

var OrderDtl = (from row in Db.OrderDtl where row.Company == Session.CompanyID && row.OrderNum == MyOrder orderby row.OrderLine descending select row).FirstOrDefault();
     {
      MyLine = OrderDtl.OrderLine;
     }
IsNewLine=true;

DeleteFirstRel

using (Erp.Contracts.SalesOrderSvcContract soSvc =  Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.SalesOrderSvcContract>(Db))
{
  if (IsNewLine = true)
  {
    SalesOrderTableset SOTS = soSvc.GetByID(MyOrder);  
    var desiredReleases = SOTS.OrderRel.Where(r => r.OrderLine == MyLine && r.OrderRelNum == 1);
    foreach(var rel in desiredReleases)
    {
       rel.RowMod = "D";
    }
    soSvc.Update(ref SOTS);
  }
}