title: CRM 2011 Plugin (Message: Delete, Pre-validation) Warning on Multi-Delete
body: <p>When I delete a MarketingList(A) i have a plugin that fires and retrieve another Marketing List(B) using a Guid stored in an attribute on MarketingList(A).</p>
  
  <p>If I select the MarketingList(A) and delete it, the MarketingList(B) is deleted correcly. But when I select both (A &amp; B) or all the records on the grid I have a warning:
  "An error has occured. The selected action was not completed for one or more records". 
  After the warning the records are deleted. </p>
  
  <p>Any help is appreciated!</p>
  
  <h1>Plugin:</h1>
  
  <pre><code>Message: **Delete**&lt;br&gt;
  PrimaryEntity: **list**&lt;br&gt;
  Stage of Execution: **Pre-Validation**.
  </code></pre>
  
  <h1>Code:</h1>
  
  <pre><code>if (context.MessageName == "Delete")
  {
      using (var crm = new XrmServiceContext(service))
      {
          List listToDelete = crm.ListSet.Where(p =&gt; p.Id == context.PrimaryEntityId).SingleOrDefault();
          List retrievedList = crm.ListSet.Where(p =&gt; p.Id == new Guid(listToDelete.tph_WitnessMarketingListID)).SingleOrDefault();
          if (retrievedList == null) return;
          crm.DeleteObject(retrievedList);
          crm.SaveChanges();
      }
  </code></pre>
  
  <p>}</p>