Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Record created through plugin doesn't trigger onCreate plugin

(0) ShareShare
ReportReport
Posted on by 420

I create and update a bunch of records with ExecuteMultipleRequest from the sdk but the created records have a oncreate step in a plugin. The plugin doesn't get executed when created that way, but it works if I create manually the record. Any idea how to fix this?

*This post is locked for comments

  • Verified answer
    ARIFNIIT Profile Picture
    ARIFNIIT 1,391 on at
    RE: Record created through plugin doesn't trigger onCreate plugin

    ExecuteMultipleRequest is an Asynch message. so check error details in response.

    Set two property ContinueOnError = true, ReturnResponses = true in ExecuteMultipleRequest

  • Verified answer
    Felippe Profile Picture
    Felippe 796 on at
    RE: Record created through plugin doesn't trigger onCreate plugin

    Maybe your plug-in are running and getting exceptions, or the Target image when you are creating manually is different from the ExecuteMultipleRequest records.

    If you can debug, check the Fault message after the ExecuteMultipleRequest or debug the plugin directly to see if at least  it fires.

    Use the properties : ContinueOnErrors =true and ReturnResponses = true to help you to find the issue.

    See msdn.microsoft.com/.../JJ863631.aspx

    "

    In general, ExecuteMultipleRequest behaves the same as if you executed each message request in the input request collection separately, except with better performance. Use of the CallerId parameter of the service proxy is honored and will apply to the execution of every message in the input request collection. Plug-ins and workflow activities are executed as you would expect for each message processed.

    Custom code in the form of plug-ins and custom workflow activities can even execute ExecuteMultipleRequest. However, there are a few key points to keep in mind. An exception thrown by a synchronous registered plug-in is returned in the response collection item Fault parameter. If a plug-in executes within a database transaction, the plug-in executes ExecuteMultipleRequest, and a transaction rollback is initiated, the rollback includes any data changes resulting from requests executed by ExecuteMultipleRequest."

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans