Couldn't obtain a strongly typed version of the target entity in Crm4 plugin RRS feed

  • Question

  • I am trying to obtain the strongly type version of the target entity in pre-create stage by following way as I found this code while googling:

    DynamicEntity target = (DynamicEntity)_context.InputParameters[ParameterName.Target];

    PlannedGiving myTarget = target.ToCrmEntity(xrmDataContext).ToCrmEntity<PlannedGiving >();

    but I am getting this error...

    'Microsoft.Crm.Sdk.DynamicEntity' doesn't contain the definition for 'ToCrmEntity'

    What am I missing here? Or is there any better way to achieve this?

    Thank you in advance.

    Wednesday, April 9, 2014 8:27 PM