Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to register plugins for email entity

(0) ShareShare
ReportReport
Posted on by

While i click the email send i have triggered the plugin with post condition and message as send and setEntity to trigger plugin to update current email sending activity date in the custom field as last activity. While i send normal mail it triggers, if i send with attachment in email this plugin not getting triggered.

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: How to register plugins for email entity

    I am going to try your suggestion by changing it to Post- condition with Async mode. In production while user tried to send mail it always triggering the message step "Send" alone, but the message step SetState and SetStateDynamicEntity not triggered always. may i know the reason for this behavior?

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to register plugins for email entity

    Hello,

    Here is what I have and tell if I think the right way - on Send of email you want to get ActualEnd value from email and update some custom field on parent opportunity. What happens at production environment - your plugin not always get triggered/or ActualEnd value is available.

    If what I wrote is your scenario here is what I can recommend - switch your plugin to Async. I'm not 100% sure it'll resolve the issue with triggering but during execution time you will have ActualEnd field populated.

    Good luck.

  • Community Member Profile Picture
    on at
    RE: How to register plugins for email entity

    Thanks!, Yes i followed your steps it helps in non prod its working fine. But in Prod sometime it stopped working. In the plugin code i am getting the ActualEnd date from Email entity and setting it to my custom field in opportunity. I there any other reason that causing this issue.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to register plugins for email entity

    I see that you have SetState and Send plugins registered for Post-Operation. Change it to Pre-Operation and test in again.

  • Community Member Profile Picture
    on at
    RE: How to register plugins for email entity

    7558.2.JPG

    7558.2.JPG

    Please find the above screenshots and guide me to resolve this problem. Attached the Steps registered for email and the plugin code.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to register plugins for email entity

    Can you please provide a screenshot of registration and code that you use?

  • Community Member Profile Picture
    on at
    RE: How to register plugins for email entity

    Hi Andrew,

    I have changed SetStateDynamicEntity message in pre-mode still it is not working. Sometimes its start working with POST condition and sometimes suddenly it stop working, is there any other reason for this behavior.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to register plugins for email entity

    Hello,

    I can confirm that behavior. The potential workaround for that - use SetStateDynamicEntity message in pre-mode to do stuff that you need.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans