static void UpdateField(IOrganizationService orgService, string entityName, Guid entityId, Entity rollupEntity, Dictionary<string, KeyValuePair<string, string>> attributes)
{
Entity _entity = new Entity(entityName);
_entity.Id = entityId;
foreach (var attr in attributes)
{
//_entity[attr.Key] = rollupEntity.GetAttributeValue<AliasedValue>(attr.Key);
if (attr.Key == "id")
{
_entity[attr.Key] = rollupEntity.GetAttributeValue<string>(attr.Key);
}
else if (attr.Key == "agreementdate")
{
_entity[attr.Key] = rollupEntity.GetAttributeValue<DateTime>(attr.Key);
}
}
orgService.Update(_entity);
}