I made a plugin for email entity and registered it on Pre Create event (child pipeline). Plugin is as simple as possible:
public class AddDescription : IPlugin
{
public void Execute(IPluginExecutionContext context)
{
DynamicEntity di = (DynamicEntity)context.InputParameters["Target"];
di.Properties["description"] = "blabla";
}
}
But description (=email body) stays the same. No exceptions are thrown. I debuged and it looks like Properties collection is changed (‘blabla’ description added) but it is not saved.
If I register the same plugin on account entity (Pre Create, child pipeline) it works fine.
Does email entity have any restrictions about changing properties on create?!!?
EDIT (MORE INFO):
I tried to change description, subject, category and subcategory and to my surprise category and subcategory changed while description and subject didn’t.
tnx for help
bye
Why are you in the child pipeline? My guess is the base activity is created in the main pipeline and the child activity (as Matt points out – only contains non-shared attributes) then goes through the child pipeline. Does this work as you expect in the parent pipeline? Maybe there’s a scenario you have to catch in the child pipeline?