public static Guid GetKeyValue(Microsoft.Crm.Sdk.DynamicEntity de, string val)
{
foreach (KeyProperty ent in de.Properties)
{
if (ent.Name == val)
return ent.Value.Value;
}
return Guid.Empty;
}
Enjoy,
Rami Heleg