Skip to main content

Notifications

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!

  • 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

Announcing the Engage with the Community forum!

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

🌸 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…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Eugen Podkorytov Profile Picture

Eugen Podkorytov 106

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

Overall leaderboard

Product updates

Dynamics 365 release plans