In CRM 2013 Business Process flow, the user can move both forward and backward to next stage and previous stage respectively using the Next/ Previous arrows. However sometimes your requirement might be to have process flows unidirectional. In that case you would not want to show the previous arrow shown to the user. Let’s see how you can achieve this using jQuery.
Following is a business process flow that we have set up for the opportunity entity.
As you can see, we have both the Previous and the Next Stage buttons here.
Let’s how we can hide the previous stage button
In google chrome, using developer tools, we can explore the HTML for the Previous Stage arrow. Following is the HTML that we have.
The Id of the Previous stage arrow is stageBackActionContainer. All we need to do is hide this div and increase the width of the “Next stage” div so that it occupies the vacant space using the code below.
function hidePreviousStageButton(stageBackActionContainer, stageAdvanceActionContainer) {
$(“#stageBackActionContainer”).hide();
$(“#stageBackActionContainer”).html(“”);
$(“#stageAdvanceActionContainer”).css(“width”, “90px”);
}
All you need to do is call the hidePreviousStageButton in the onload of the form.
Hope this helps!
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.
Hi, I disabled both the previous and next buttons. Now I want to increase the width of the last stage. I tried below code but it did not help, please suggest:
$(“#stage_4”).css(“width: 400px”);
I think there is a small syntax error in jQuery. I think it should be $(“#stage_4”).css(“width”, “400px”);
Can you try this and let me know if it is working
Hi, this works fine but there’s a short period of time before the form finish loading when the button is still enabled and if the user is quick enough, it can click on it and go to the previous stage. Do you have a workaround for this scenario?
Hi Gabriel,
Thanks for reading my blog. yeah there is a short span. However the code can only execute with the form load. So not really we can do this to make it faster. I think this risk comes as the peril of this unsupported customization 🙂
Best Regards
Debajit