Hello Team,
I want to call Javascript on Process Stage Next button in CRM how can i call can you suggest me ?
Hi,
You can register your JS function on OnPreStageChange Event or OnStageChange Event.
Please Refer to docs:
Good Luck !
Hi Ashik Patel,Check the below document from Microsoft that shows all the events and methods available in JavaScripthttps://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg334481(v=crm.8)?redirectedfrom=MSDN#BKMK_OnStageChange
Reference Code:-Xrm.Page.data.process.addOnStageChange(onStageChange);
function onStageChange()
{// Alert either "next" or "previous" based on button clicked.alert(ExecutionContextObj.getEventArgs().getDirection());
if(ExecutionContextObj.getEventArgs().getDirection()==="next"){//your code goes here
}
if(ExecutionContextObj.getEventArgs().getDirection()==="previous")
{}}Thanks,Manoj.Please mark this as VERIFIED if it helps.
Yes Ashik Patel - you can use below handler at onload event to call your function.
formContext.data.process.addOnStageChange(YourFunction);
Please refer below link for more details.
docs.microsoft.com/.../addonstagechange
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Rishabh Kanaskar 235
MVP-Daniyal Khaleel 177
Tom_Gioielli 156 Super User 2025 Season 2