I need to write a plugin for Dynamics CRM 4.0 that runs when a closed feature opens again in order to modify salesstagecode. My questions:
- When I register a new step to the plugin, what attributes do I need to filter?
- What property on the object should I check the value of? and
- What should I look for for the value of this object so that I can determine if the plugin will continue to execute?
I usually wrote asynchronous workflows, and my experienced email writing plugins are still evolving, so I will be grateful for any help and clarifications that may be offered.
Please see below the skeleton of the plugin that I wrote
public void Execute(IPluginExecutionContext context)
{
if (context.InputParameters.Properties.Contains("Target") && context.InputParameters.Properties["Target"] is DynamicEntity)
{
ICrmService service = context.CreateCrmService(false);
DynamicEntity entity = (DynamicEntity)context.InputParameters.Properties["Target"];
if (entity.Name == EntityName.opportunity.ToString())
{
if (entity.Properties.Contains())
{
}
}
}
}