Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Assign message trigger two times

$
0
0

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.


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>