I wrote a plug-in for Dynamics CRM 2015 and I want to trigger it every time the user clicks on an account. When I register it with "Update" message, it's fired once. However, when I register with "Retrieve" message, it's fired multiple times. I tried this code below but it didn't work:
if (context.Depth > 1)
{
tracingService.Trace("Depth > 1");
return;
}
I checked the Trace Logs and saw that the plug-in was fired three times in a row (with the same depth
= 1). If I set the Excution Mode
from Sync
to Async
, the plug-in will be fired 6 times.
Any advice, please?
Edit: This is my plug-in registration
This is the plug-in was fired three times in Trace Log