Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SetState plugin is not triggered when status is changed from custom workflow activity

(0) ShareShare
ReportReport
Posted on by

Hello guys,
I have a custom workflow activity . This custom workflow activity as part of its functionality changes the status of a quote record.
Now this custom workflow activity is not executed from the quote record. It is executed in the background
on a different entity. There is also a few plugins which has steps on SetState of quote entity.Specifically 5 steps. (4 on pre-operation and 1 on post operation.)
Now I am under the assumption that, when the custom workflow activity changes the status of the quote record, these 5 steps of plugin needs to be executed. Isn't that expected behaviour? Because right now it is not happening in my case. None of the plugins are executed.

*This post is locked for comments

  • Suggested answer
    Elliott Profile Picture
    Elliott 125 on at
    RE: SetState plugin is not triggered when status is changed from custom workflow activity

    It could be that you have plugins registered on the SetState message of quote, but instead the custom workflow activity is changing the statecode/statuscode attributes?

    If this is the case you could either update the custom workflow activity to use the SetState request, or register the plugins on Update instead, filtering to only the statecode/statuscode attributes.

  • RE: SetState plugin is not triggered when status is changed from custom workflow activity

    Hello Aric,

    Thank you for the response. I can confirm that the plugin is not running because I setup a test message in one of the fields and it did not get populated.

  • Aric Levin Profile Picture
    Aric Levin 30,188 Moderator on at
    RE: SetState plugin is not triggered when status is changed from custom workflow activity

    It doesn't matter where you are changing the plugin from, SDK, Workflow, Api... The Plugin Step Message should still execute.

    I would add some tracing into the Plugin and see if it executes at all and exits at a particular location, or does not execute at all.

    EDIT: Even better, since you are running On-Premise, use Remote debugger and check where the issue is by adding a breakpoint to your code in the Plugin code.

  • RE: SetState plugin is not triggered when status is changed from custom workflow activity

    Hello Wei,

    Thank you for the response. If you are referring to using EntityMoniker to change the status of the quote - Yes, I am using EntityMoniker. The plugin is also registered in both SetState and SetStateDynamicEntity. Both are preoperation, synchronous, and execution order is 5. The custom workflow which updates the status of the quote updates it from a different entity. Hence, I am not on the quote record when the status is being changed. Does this matter?

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: SetState plugin is not triggered when status is changed from custom workflow activity

    Hi,

    Please check following items:

    1. you should be using EntityMoniker instead of Target.

    2. you need to register the plugin to both SetState & SetStateDynamicEntity messages.

    Refer to below article for reference purpose.

    thomasthankachan.wordpress.com/.../plugin-usage-of-setstate-and-statestatedynamicentity-message

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans