Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

CRM 2016 Plugin for update works only during debug, not in normal operation.

Posted on by Microsoft Employee

What could cause this plugin to work only in debug mode?

I created a C# plugin for on-premise CRM. I register the assembly in "sandbox" mode because eventually this CRM will be hosted online and my plugins must work in that environment.

The plugin code checks several fields and can cause the modified contact record to update multiple times such that workflow processes in CRM will trigger.

With the plugin registered, I update a contact record and the expected updates do not happen.

I did the following:

  1. started profiling on my plugin step
  2. changed a contact and saved
  3. saved the error text
  4. stopped profiling
  5. started debug
  6. attach Visual Studio
  7. step through the code
  8. 2 updates to the contact record are initiated by the code
  9. 2 updates to the contact record occur in CRM which I verify by viewing the record in the browser
  10. the plugin code finishes with no exceptions

Registration info:

1263.a.png

I add a step to handle the update message and watch for a single field to change.

8625.b.png

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CRM 2016 Plugin for update works only during debug, not in normal operation.

    After tracing the code, there was no traces written telling me the code was never triggered. The field I was watching was a calculated field and that was not causing the step to execute. When I tested with a different field, then it worked. So I learned that neither workflows, nor plugin steps can trigger from calculated fields.

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