Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Needs to discuss about the best practices to write a plugin for Dynamics 365

(0) ShareShare
ReportReport
Posted on by 2,057

Hello Everyone,

Hope you are doing well.

This discussion is regarding to write a plugin code in one .cs file or multiple .cs file.

We have seen that many developers are using only one .cs file to manage the code of all the messages of the entity. At the other hand some of the developers are creating more than one .cs file based on the Message. Could anyone confirm what should be the best practice to manage the Plugins?

  • Ray Profile Picture
    1,516 on at
    RE: Needs to discuss about the best practices to write a plugin for Dynamics 365

    One file compare with multiple files:

    Advantages:

    1. Less plugin can cause less conflict in plugin registration.

    Disadvantages:

    1. Hight coupling.

    2. Less flexable

    3. Need consider deepth, order, trigger point, async/sync, etc.

    So i vote for multiple files.

    BTW, you can find the OOTB plugin in plugin registration tool and see how they do it.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Needs to discuss about the best practices to write a plugin for Dynamics 365

    Hello,

    In my opinion - one plugin - one class, one cs file.

    Where there could be a common base - I use base classes and put all the shared elements in it and inherit plugin classes from it.

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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans