web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    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

  • Community Member Profile Picture
    on at

    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?

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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.

  • Community Member Profile Picture
    on at

    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.

  • Suggested answer
    Elliott Profile Picture
    125 on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans