web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

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

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    Try register your email asynchronously and see if that works?

    If you plugin is registered synchronously, an asynch workflow will not execute the plugin step.

  • chakkay Profile Picture
    594 on at

    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?

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    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.

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

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

  • rath.amit38@gmail.com Profile Picture
    2 on at

    Hi,

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

    Thanks

    Amit Kumar Rath

  • chakkay Profile Picture
    594 on at

    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.

  • chakkay Profile Picture
    594 on at

    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
    594 on at

    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?

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    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.

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans