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)

Call some javascript when click next button of business process and call another javascript when click on back button.

(0) ShareShare
ReportReport
Posted on by 290

Call some javascript when click next button of business process and call another javascript when click on back button.

Please let me know how to find clicked NEXT button and PREVIOUS button of business process flow bar in javascript.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Hamzeh Zawahreh Profile Picture
    3,674 on at

    dear Mohammad Sharique

    check this site on Write scripts for business process flows.

    https://msdn.microsoft.com/en-us/library/dn817874.aspx

    check these scripts

    Move to the next stage when all required steps are completed to make it the current active stage.
    Use Xrm.Page.data.process.moveNext
    Move to the previous stage and make it the current active stage.
    Use Xrm.Page.data.process.movePrevious
  • Suggested answer
    Hamzeh Zawahreh Profile Picture
    3,674 on at

    hi

    here there is sample code:

    dineshcrm.wordpress.com/.../business-process-flow-javascript-approach-crm-2015

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    There are two methods that going to help you, you can pass your function name that you want to execute when next and previous button clicked.

    Use Xrm.Page.data.process.moveNext

    msdn.microsoft.com/.../6b79eb8c-8293-4d3a-a3a7-ea35157cde37

    Xrm.Page.data.process.movePrevious

    msdn.microsoft.com/.../6b79eb8c-8293-4d3a-a3a7-ea35157cde37

    Thanks

  • Suggested answer
    Royal King Profile Picture
    27,686 on at

    Add a onload event to attach onchange event for the stage then in the onstage event execution context eventargs will return which button click either "next" or previous

    Check the below document from microsoft that shows all the events and methods available in javascript

    https://msdn.microsoft.com/en-us/library/d88d5f21-6385-443b-91f2-0ec0c16b1324#BKMK_OnStageChange

    Sample code

    Xrm.Page.data.process.addOnStageChange(onStageChange);

    function onStageChange()

    {

    alert(ExecutionContextObj.getEventArgs().getDirection()) // alerts either "next" or "previous" based on button clicked.

    if(ExecutionContextObj.getEventArgs().getDirection()==="next")

    {

    }

    if(ExecutionContextObj.getEventArgs().getDirection()==="previous")

    {

    }

    }

  • Community Member Profile Picture
    on at

    msdn.microsoft.com/.../dn817874.aspx

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