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 :
Customer experience | Sales, Customer Insights,...
Suggested answer

Set business process flow stage dynamically using JS

(0) ShareShare
ReportReport
Posted on by 10

I am trying to set the active stage of my business process flow when my condition is false. However I am getting the "work flow with ID <> does not exist." error even when the stage ID is correct.pastedimage1629448638630v1.png

Here is my JS code 

pastedimage1629448909857v6.png

And here is the ID of the stage I would like to set active.

pastedimage1629448768262v5.png

I have the same question (0)
  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at
    RE: Set business process flow stage dynamically using JS

    Please go through the link: https://carldesouza.com/using-javascript-to-go-to-next-stage-in-business-process-flows/. It will help you a lot.

    Let me know if I can help you more.

    Thanks

    Regards,

    Abdul Wahab

  • Suggested answer
    Rakesh90 Profile Picture
    200 on at
    RE: Set business process flow stage dynamically using JS

    Hi kthlnvrgna,

    You are using setActiveProcess which is incorrect. This method is used to set an Active BPF to the record,

    In your case you should use setActiveStage like below

    formContext.data.process.setActiveStage(stageId, callbackFunction);

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 > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 165

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 148 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans