web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Trigger a workflow on a process stage change

(0) ShareShare
ReportReport
Posted on by

It seems the only way to get a report to run is to identify when a process stage changes and use Workflow to update a field at that point.

I have not been able to identify when this happens as the Workflow needs to run against a Lead and there is no real change to a Lead now that the Process is normalised out.

How can I identify when a process stage changes (in any direction) and so populate a user definable field?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Vijay Waghmare Profile Picture
    on at

    Since the processes introduced in CRM 2013, entity which are having processes define has two attributes to identify the current selected process and stage, processid and stageid

    as per your requirement you can have workflow registered on field change for field "stageid"

    Please refer below blog for more details,

    code.msdn.microsoft.com/.../Change-Dynamics-CRM-2013-a6beb85e

    Thanks,

    Vijay

  • Chris Grubb Profile Picture
    30 on at

    "How can I identify when a process stage changes (in any direction) and so populate a user definable field?"

    I am trying to determine this so that I can add some javascript.

    You would think that you could use Xrm.Page.getAttribute('stageid').addOnChange(<whatever>);

    But the event doesn't get fired when the user changes stage :(

  • Suggested answer
    Vijay Waghmare Profile Picture
    on at

    Place the control on the form to fire the onchange event. By defalt these (process fields) are not placed on the form.

    Thanks,

    Vijay

  • Chris Grubb Profile Picture
    30 on at

    Hi Vijay,

    In my instance I'm looking at the modifying the Opportunity form. I don't see any way of adding the "StageId" to the opportunity form in the designer, even when showing "All Fields" on the filter and unchecking the "Only show unused fields" checkbox. Am I missing something?

    Regards,

    Chris

  • Vijay Waghmare Profile Picture
    on at

    On the opportunity form "Sales Stage" enlist all the available stages for record, may be you can use this field for your operation.

    Thanks,

    Vijay

  • Chris Grubb Profile Picture
    30 on at

    I think there might be some confusion. The stage I (and I presume Keith) are referring to is the business process flow stage, not the sales stage.

    I eventually worked around my problem by wiring up the following in an OnLoad

               function addEventToStageId() {

                   var stage = Xrm.Page.getAttribute('stageid');

                   if (stage == null) {

                       setTimeOut(setTimeout(function() { addEventToStageId(); }, 1000));

                   }

                   stage.addOnChange(<someFunction>);

               }

    and also adding the following in the OnSave

               function onSaveOpportunity() {

                   var stage = Xrm.Page.getAttribute('stageid');

                   if (stage != null) {

                       stage.fireOnChange();

                   }

               }

    I noticed that whenever you change the business process flow stage that the record was saved. It seems to be working well enough.

  • Community Member Profile Picture
    on at

    Hi Keith

    This is what you can refer:

    www.powerobjects.com/.../executing-workflow-upon-change-business-process-flow-stage-dynamics-crm

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans