Friday, August 7, 2009

Function to get value from dyanamic entity field

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