Hello CRM World,
I am facing peculiar issue. I have a plugin registered on send email message which works fine when i manually send an email from Dynamics CRM. I also have OOB asynchronous workflow which will send email. But my plugin doesn't get triggered when this email is sent from workflow.
This is really complicating my business scenario. Can anyone help me out on how to trigger the plugin when i send email from OOB asynchronous workflow?
*This post is locked for comments
Resolved the issue. Changes the Plugin message from "send" to "create" and now my background workflow sending email is triggering the plugin.
I wrote trace and increased the depth to more than 2 but still not working. The basic flaw is that if we register a plugin on "Send" message only button click of reply will trigger this plugin and background email send wont trigger the plugin. That might be the reason why i dont see any trace logs even though i completely filled my code with traces.
THANKS YOU ALL FOR RESPONDING
Are there any errors in the Plugin trace log that can help us out?
Also, can you add tracing in different places in your plugin so that it output where the error might be?
Hi ,
Is there any context depth check having in your plugin code , could you please increase make it maximum 2 instead of 1 and try once.
I am saying as may be it's returning from the first line of plugin.
Sorry i cant share any code or screenshot as it is company security policy.
Again explaining the whole scenario:
I have written a Synchronous plugin on post stage which fires on Send message and do some action.
But when i send an email from OOB asynchronous/synchronous workflow the plugin is not getting fired. Why?
Hi Wei,
I double checked the workflow. It looks fine for me.
I tried registering my plugin on create message and plugin even got fired when i send an email through background workflow. But as part of create message, you will get email Entity as input parameter. The sad thing is email hasent been created yet in system and i dont know how i am getting an email GUID. When i try to service.update(_email) or service.create(_email) it throws error saying there is no such record existing
CRM Behaving weird!!!!!!!
Hi Goutam,
I did not get any error. I checked in Plugin trace log and i did not find any log saying my plugin on "Send" message executed. I am on D365 cloud so there is no way i can touch or reset IIS server.
Hi,
Can you share your code or the screen shot of it so that the scenario can be analysed?
Thanks
Amit Kumar Rath
Hi,
double check your workflow, the action for email is under create or send?
Hi ,
Did you get any exception or error ? Can you please check in audit log what exactly is happening?
Also when you changed the plugin Asynchronous after making change did you reset IIS?
Please reset asynchronous process and IIS and try once.
Aric,
Just now tried. I changed my plugin from synchronous to asynchronous and ran OOB workflows as asynchronous (as it was before). But still its not working. I am unable to see a log in Plugin trace log.
Any more suggestions?
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
52
Victor Onyebuchi
6