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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Plugin PreOperation: Changes in activites are not working anymore

(0) ShareShare
ReportReport
Posted on by 181

hi,

has anyone running a plugin in preoperation on any activity (Task, Email, ...)?

Every change I make is not saved in the system. it gets just ignored. 

This was working well 1-2 month ago...any ideas?

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Can you please be more specific with your issue?

  • TKoller Profile Picture
    181 on at

    sure.

    I have a plugin which is registered on task(tried other activities, too) PreOperation-Update.

    The plugin is updating some attributes (doesnt matter which one) but these changes are not updating the record in ce.

    After the update the modified fields (inside the plugin) have the same old value.

    The Plugin worked well for many month and suddenly it stopped working.

    I had another plugin on email where I modified the title and body. This was also working well till 1-2 Month ago.

    And this has nothing to do which a specific version, its the same problem everywhere I use the plugin.

    What I also noticed:

    When I mark a task to be completed my update-plugin doesnt get triggered but the actualend was updated from the system.

    I thought no matter where someone updates an attribute: if a plugin is registered on update it will get notified about that change..

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Can you please provide the code of the plugin and the screenshot of the registration step?

  • TKoller Profile Picture
    181 on at

    hi Andrew,

    thanks for your support but this is no problem of the code. I'm developing plugins for about 9 years now.

    Maybe you can try it out in one of your online-environments?

    1. create a plugin

    2. register it on PreOperation Update of Task (or any other activity)

    3. change any field (no one you changed on the form)

    4. see that it has no effect anymore.

    it only works when I change a field that was modified on the form or when I register the step in postoperation and fire an update-request myself on the same entity-record which is just ugly AF!!

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    With all respect, I develop plugins for 14 years now but it doesn't mean my code is perfect and works always from the first attempt. We're all human beings and we all can do mistakes.

    Nevertheless, I developed the following simplistic plugin to check what you asked:

    using System;
    using Microsoft.Xrm.Sdk;
    using Microsoft.Xrm.Sdk.Extensions;
    
    namespace ClassLibrary2
    {
        public class TestPrePlugin : IPlugin
        {
            public void Execute(IServiceProvider serviceProvider)
            {
                var context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
                var target = context.InputParameterOrDefault("Target");
                target["scheduledend"] = DateTime.Now;
            }
        }
    }
    

    Here is step registration screenshot:

    pastedimage1664986781514v1.png

    I tested and I got the expected result.

  • TKoller Profile Picture
    181 on at

    hi Andrew,

    I didnt mean it that way.

    But like I said: the plugin was working well for a couple of month and suddenly stopped working. And I have different plugins at different customers and they all stopped working (didnt change the attributes anymore) on activities.

    Now to your example:

    Create-Mode is no problem, its the update-preoperation.

    Can you check this?

    thanks for your help!

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Tested the update with the same result. It works for me.

    If you experience that kind of issue I would recommend reaching out to Microsoft Support and open a ticket to get this issue moving.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans