Thursday, September 10, 2009

Set Value to Dynamic entity

Microsoft.Crm.Sdk.DynamicEntity entity

//Set value to CrmNumber
Microsoft.Crm.Sdk.CrmNumber number = new Microsoft.Crm.Sdk.CrmNumber();
number.Value = ToInt(propertyValue);
entity.Properties[propertyName] = number;

//Set Value to String
entity.Properties[propertyName] = propertyValue.ToString();


Enjoy,
Rami Heleg