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
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
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
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.
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.
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...
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.
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?
Ok. But How can i capture webservice request values in the plugin on creation?
I'm sorry but you have no other way.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156