Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Prevent Plugin to trigger on Pre-Operation

Posted on by Microsoft Employee

Hi,

I need to trigger a plugin on pre-operation only on specific conditions based on my code.

Is there any way to do that ?

*This post is locked for comments

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Prevent Plugin to trigger on Pre-Operation

    I think there is confusion somewhere..

    Create plugin will trigger when you call CRM service.Create(...)

    Update plugin will trigger when you call CRM service.Update(...)

    You cannot define conditions when the plugin will trigger or not - it's part of the even pipeline. You can only define, in the plugin code, what to do depending on the values passed through the record attributes

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Prevent Plugin to trigger on Pre-Operation

    6318.Plugin.JPG

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Prevent Plugin to trigger on Pre-Operation

    Hi, I am developing an REST api, I will get input Request, based on that I will create/update entity in CRM. So Before creating i need to trigger plugin (on Pre-Operation) to create UniqueID. So now I have to prevent that plugin to trigger based on the input request.

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Prevent Plugin to trigger on Pre-Operation

    If you have a web service that's calling CRM, and you have a plugin in CRM that you only want to kick in under some conditions.. Maybe create a special field in your entity and populate that field from the service to indicate (for the plugin)if it should do anything or not.

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Prevent Plugin to trigger on Pre-Operation

    Where are you calling your web service from? The plugin?

    Can you please provide more detail of what exactly you are trying to do? It seems like there are some missing pieces to the puzzle here. Also, plugins execute on particular events (such as Create, Update, Delete) as you mentioned previously, what event are you performing before the plugin executes, and what does the plugin have to do exactly?

    Thanks...

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Prevent Plugin to trigger on Pre-Operation

    Actually In the webservice I am trying to create or update based on the given Request. So on create -

    I have a plugin trigger on Pre operation which will generate unique Id.

    So for some conditions on the request. I want to prevent the plugin to create Unique Id.

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Prevent Plugin to trigger on Pre-Operation

    I'm sorry but I'm not sure what kind of issues you experience.

    What's the difference when to call webservice - during create, update or delete?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Prevent Plugin to trigger on Pre-Operation

    Ok. But How can i capture webservice request values in the plugin on creation?

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Prevent Plugin to trigger on Pre-Operation

    I'm sorry but you have no other way.

  • Suggested answer
    Ivan Ficko Profile Picture
    Ivan Ficko 1,380 on at
    RE: Prevent Plugin to trigger on Pre-Operation

    Calling a web service inside plugin code just to check condition will be quite tricky if you call it on a frequently used action like RetrieveMultiple.

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans