Friday, March 19, 2010

To retrieve dynamic entity in Create and Update Plugin

// Check if the input parameters property bag contains a target
// of the create operation and that target is of type DynamicEntity.
if (context.InputParameters.Properties.Contains("Target") &&
context.InputParameters.Properties["Target"] is DynamicEntity)
{
// Obtain the target business entity from the input parmameters.
entity = (DynamicEntity)context.InputParameters.Properties["Target"];
}
else
{
throw new InvalidPluginExecutionException("Invalid Context");
}

No comments: