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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Shall I write plugin methods as static or instance?

(0) ShareShare
ReportReport
Posted on by 155

I´m creating a plugin (sync and post-operation) that will be run perhaps 100 days per day. It contains approx 15 methods.

I´m struggling to understand if it best if my methods are Static or instance methods in this case?

Thanks in advance!

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Shall I write plugin methods as static or instance?

    Hello,

    I would say you should use instance methods but in the case of plugins, it should not matter. Anyway, it's up to you to decide. You can check the following - docs.microsoft.com/.../static-classes-and-static-class-members

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Shall I write plugin methods as static or instance?

    Hi Kranis,

    It's prefered to writhe the execute methods as a stateless operation.

    Take a look here: docs.microsoft.com/.../develop-iplugin-implementations-stateless

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
DAnny3211 Profile Picture

DAnny3211 134

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 115

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans