Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

Posted on by 594

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

  • Verified answer
    chakkay Profile Picture
    chakkay 594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    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

  • Verified answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    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?

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    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.

  • chakkay Profile Picture
    chakkay 594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    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?

  • chakkay Profile Picture
    chakkay 594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    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!!!!!!!

  • chakkay Profile Picture
    chakkay 594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    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.

  • RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Hi,

    Can you share your code or the screen shot of it so that the scenario can be analysed?

    Thanks

    Amit Kumar Rath

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Hi,

    double check your workflow, the action for email is under create or send?

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    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.

  • chakkay Profile Picture
    chakkay 594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    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?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans