title: CRM 2011 KeyNotFoundException exception
body: <p>I am new to CRM development.
  I have a Custom Entity "customer". This Entity has a Field called "defaultcustomer", which can be TRUE or FALSE. I am working on a Plug-In where i need to set the "defaultcustomer" to FALSE for all the "Customers". I am doing it as below:</p>
  
  <p><strong>FACTS:</strong></p>
  
  <p>I have registered the plugin for the entity "customer" itself. So when the Entity "customer" is updated, the plugin fires.</p>
  
  <pre class="lang-csharp prettyprint-override"><code>private void MakeAllNonDefault()
  {
  
      try
      {
          QueryExpression query = new QueryExpression("customer");
          query.ColumnSet = new ColumnSet("defaultcustomer");
  
          EntityCollection retrieved = service.RetrieveMultiple(query);
  
          foreach (Entity myCustomer in retrieved.Entities)
          {
  
              myCustomer["defaultcustomer"] = false;
              service.Update(myCustomer);
          }
  
      }
      catch (Exception ex)
      {
          throw new InvalidPluginExecutionException("An error occurred in MakeAllNonDefault(): " + ex.ToString());
      }
  }
  </code></pre>
  
  <p><strong>ERROR:</strong>
      It throws error on this line: </p>
  
  <pre><code>myCustomer["defaultcustomer"] = false;
  
  System.Collections.Generic.KeyNotFoundException: 
  The given key was not present in the dictionary. 
  </code></pre>