18 January 2011

ActivityParty issue

In some my previous post a mentioned issue with iterating though IEnumerable<ActivityParty> collection.
Code like


PhoneCall call;


foreach (var party in call.To)
{
  DoSomething(party);
}


caused error  "Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type 'YourDataModel.ActivityParty'"


But it happens only if you code is inside plug in. In client applications it works well. I have tested both with SDK beta and release versions.

No comments:

Post a Comment