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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set next business process stage "active" using a workflow

(0) ShareShare
ReportReport
Posted on by

I created a workflow step that checks a field in the business process whether it is set to "yes" and if it is I want to set the next stage active I just cant find how to set the next (or specific stage) active in a workflow step.

Thanks so much!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mohamed Bashir Profile Picture
    105 on at
    RE: Set next business process stage "active" using a workflow

    I used the solution provided here to set a stage as active in my process based upon my check conditions.  It worked perfectly for our environment.  github.com/.../Dynamics-365-Workflow-Tools

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at
    RE: Set next business process stage "active" using a workflow

    Your can write your own Custom Workflow Activity to move to the next stage, or use the Workflow Tools by Demian Raschkovan mentioned in the above post.

    The update is simple enough. You need to get the Record Id, Stage Id and the Process Id, and call the following function:

           private void UpdateStage(IOrganizationService service, EntityReference currentRecord, Guid processId, Guid stageId)

           {

               Entity current = new Entity(currentRecord.LogicalName);

               current.Id = currentRecord.Id;

               current["processid"] = processId;

               current["stageid"] = stageId;

               try

               {

                   service.Update(current);

               }

               catch (FaultException<OrganizationServiceFault> ex)

               {

                   throw new Exception("WorkflowUtils.ChangeProcessStage.UpdateStage: " + ex.Message);

               }

               catch (System.Exception ex)

               {

                   throw new Exception("WorkflowUtils.ChangeProcessStage.UpdateStage: " + ex.Message);

               }

           }

    Just make sure that if you have to bypass a stage, you Update the stage, and then update the next stage.

    For example if you want to move from Stage 1 to Stage 3, you call the Update function on Stage 2 and then call the Update function on Stage 3.

    Hope this helps.

  • Community Member Profile Picture
    on at
    RE: Set next business process stage "active" using a workflow

    Thanks so much Aric and Mohamed! I'm trying the Workflow Tools by Demian Raschkovan and I'm getting this error (please see image). Any advice? Please let me know if more info is needed to help me figure this out thanks!

    4862034.Capture.PNG

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Set next business process stage "active" using a workflow

    Hi Barry ,

    I am not sure using workflow it is possible or not ,Instead of workflow could you please registered one java script method  MoveBPFNextStageAutomatic() . This is working fine for me , hope this will help you.

    function MoveBPFNextStageAutomatic() {
        Xrm.Page.data.save().then(successCallback, errorCallback);
    }
    
    
    function errorCallback(message) {
        alert("error")
    }
    
    function successCallback(message) {
    
        var currentStageId = Xrm.Page.data.process.getActiveStage().getId();
        var selectedStageId = Xrm.Page.data.process.getSelectedStage().getId();
        if (currentStageId != selectedStageId) {
            Xrm.Page.data.process.setActiveStage(currentStageId, callbackFunction)
    
        }
    }
    
    
    
    function callbackFunction() {
        var activeStage = document.querySelector(".processStageContainer.activeStage");
        if (activeStage)
            activeStage.click()
    }
  • Mohamed Bashir Profile Picture
    105 on at
    RE: Set next business process stage "active" using a workflow

    Barry, I would check plugin assemblies under system>customizations>customize the system  to see what assemblies are loaded on your environment.  You should have one labeled msdyncrmWorkflowTools.  If you do not, double check the solution install, and as recommended, test in a dev environment before pushing to prod

  • Community Member Profile Picture
    on at
    RE: Set next business process stage "active" using a workflow

    Thanks just checked and the assembly is there...

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at
    RE: Set next business process stage "active" using a workflow

    Have you used the workflow tools for anything else?

    Seems like version 1.0.51 is pretty new and might have a bug.

    We are on v1.0.37 on my current project and it is working properly.

    Possibly downgrade if you haven't used it yet.

  • Community Member Profile Picture
    on at
    RE: Set next business process stage "active" using a workflow

    Thanks Aric! I will try v1.0.37 and let you know how it is.

  • Community Member Profile Picture
    on at
    RE: Set next business process stage "active" using a workflow

    I got it to work with v1.0.41 thank you!

  • Vijayakumar Kenchugundu Profile Picture
    1,077 on at
    RE: Set next business process stage "active" using a workflow

    Did it work on Cross-Entity BPF? I need to set process stage to Negotiate (on Quote) from Evaluate (on Opportunity). Any thoughts?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans