Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

one plugin for different entities

Posted on by 2,397

Hi, usually, we select specific entity to create plugin, is there anyway to create a plugin for different entities? Thanks

*This post is locked for comments

  • Inogic Profile Picture
    Inogic 24,094 on at
    RE: one plugin for different entities

    You can create a generic (common) plugin which can be registered for different entities for any messages. It will work if you are working on same named fields throughout. But suppose you need to use different fields based on entity names or based on it any other business logic needs to be implemented then you may use the context.PrimaryEntityName = “specific entity logical name” and split the logic. When context is the object of IPluginExecutionContext.

    Hope this helps to implement your logic in the plugin.

    If this answered your question, please make sure to Mark this as an Answer.

    Thanks!

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: one plugin for different entities

    Technically, plugins are not associated with entities till you register a message processing step. If you are using a plugin registration tool, for example, you can register any plugin for any entity (whether it will work or not depend on how you write code for that plugin, of course)

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: one plugin for different entities

    Hello,

    There are bunch of generic plugins and the great example is AutoNumbering plugin. It can work for any target entity. Do you have any specific question?

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