Hi CRM Experts,
I have below plugin which will trigger on Assign message:
public class OnContactCreateSetContactOwner : PluginBase
{
protected void ExecuteOnAssignSetContactOwner(LocalPluginContext localContext)
{
IPluginExecutionContext context = localContext.PluginExecutionContext;
ITracingService tracing = localContext.TracingService;
IOrganizationService crmService = localContext.OrganizationService;
EntityReference targetRef = (EntityReference)context.InputParameters["Target"];
EntityReference assigneeRef = (EntityReference)context.InputParameters["Assignee"];
// here i have some logic to retrieve teamId.
assigneeRef.Id = teamId;
}
}
This plugin is giving me the expected result but triggering two times. Currently, it is registered on Pre - Validation but behavior is same if i register it on Pre-Operation or Post-Operation.
any idea, what may be the possible reason for this issue. Any help is really appreciated.