Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Reactivate Business Process Flow

Posted on by 130

In my project, I have this Business Process Flow. At Closure, it reaches the Finished status.

2620.Capture.JPG

I can reactivate it from the command bar, like this.

Reactivate-BPF.jpg

How can I reactivate it programmatically as I need to perform some more action on Re-Activation?

Javascript (Xrm.Page.data) or SDK code reference will be a great help.

*This post is locked for comments

  • Verified answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Reactivate Business Process Flow

    Hi Atul Sharma,

    You can programmatically set the status of the business process flow using the javascript code below.

    Xrm.Page.data.process.setStatus(status, callbackFunction);

    status is a string that can be active, abandoned or finishcallbackFunction is an optional function to call when the operation is complete.

    In order to reactivate the workflow, use the status active as shown below.

    Xrm.Page.data.process.setStatus("active");

    For more details, see the links below.

    https://stackoverflow.com/questions/43346218/programatically-finishing-business-process-flow-in-dynamics-crm-365

    https://msdn.microsoft.com/en-gb/library/dn817878.aspx#BKMK_InstanceMethods

    Hope this helps.

  • Suggested answer
    SCV Profile Picture
    SCV 1,004 on at
    RE: Reactivate Business Process Flow

    Hi Atul,

    You can create a ribbon button and add a javascript on it to do the following:

    Xrm.Page.getAttribute("stageid").setValue(GuidOfTheFirstStageOfYourBusinessProcessFlow);

    And then you can perform your own operations as well.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans