title: Change organizer in all appointments in MS CRM
body: <p>I'm trying to change the organizer in the appointments with a plugin.
  I have a hash table to match the guids that oughts to be replaced with the new ones.
  I have a fallback user that I can use when there is no match</p>
  
  <pre><code>if (entity.Attributes.Contains("organizer"))
  {
      var organizers = (EntityCollection)entity["organizer"];
  
      var record = (Entity)organizers.Entities[0];
  
      var organizer = (EntityReference)record["partyid"];
      // create activity party record
      Entity activityParty = new Entity();
      activityParty.LogicalName = "activityparty";
  
      EntityCollection colAP = new EntityCollection();
      colAP.Entities.Add(activityParty);
  
  
      if (guidHash.ContainsKey(organizer.Id.ToString()))
      {
          activityParty.Attributes["partyid"] = new EntityReference("systemuser", new Guid(guidHash[organizer.Id.ToString()]));
      }
      else
      {
          activityParty.Attributes["partyid"] = new EntityReference("systemuser", new Guid(migrationUserGuid));
      }
      entity.Attributes["organizer"] = new EntityCollection();
      entity.Attributes["organizer"] = colAP;
  }
  </code></pre>
  
  <p>I registered the plugin on the pre operation step, but nothing happens, the user is still the old one.</p>
  
  <p>Am I doing something wrong with the way I set the EntityCollection?</p>