Notifications
Announcements
No record found.
I was able to hide using JScript the Next button in the Business Process stages in Classic UI.
Is there a way also to hide this in unified interface?
*This post is locked for comments
Hi,
There is no supported way to hide the button, not even in classic UI. If you do it with unsupported method, it may not work with the latest version when released.
Hope this helps.
The workaround would be to make field mandatory , so that until and unless you fill the value in BPF you won't be able to move next stage.
Also could you please why you want to hide next button ?
Sorry, I was able to hide the button of the Next in the BPF using JScript in the Classic UI, but not in Unified interface.
I'm aware of making some fields mandatory.
We need it to hide because we have some validations using workflow to prohibit moving the stage from A to B.
These fields are available across multiple entities, so we use workflow to validate it.
The business users also does not want that Next button. That's why we need to hide/remove it.
Hi
If you handing all in the workflow, one option would be to convert the workflow to Real Time and perform your validation and use the Stop Workflow step with Cancelled status and a custom error message. This should prevent the user from moving to the next stage and will also display an appropriate error message. The workflow will have to be on status change of the BPF.
If you do not prefer the above solution, please see below
The reason your Next button hiding works on Classic not on UCI is that the elements are completely different, UCI is a completely new and modern UI so you will have to update your javascript to find the Next button for UCI. Now if you want this hiding script to work on both UCI and Classic then your JS should cater for both scenarios.
If you want to go ahead with UnSupported approach for UCI, I don't see why you cannot check the DOM element and get to the DOM element and do a Display:None.
Hello Benjamin, I have a need to hide the next Stage Button, is it possible to share your solution with step by step instructions please?
Here is my email: yboureguaa@hotmail.com
Hi Yazid,I am also having this functionality to implement in my current project. Do you have solution on this? if yes please share it with me.
Regards,
Shaikh Sharef
Hi, I was able to lock the next stage button and kept the back stage and set active as is because I need my users to be able to restart the flow from an earlier Stage.
Here is my code that I can share with you, the user when he click on next Stage get a message that you can customize.
Please add this code on OnLoad in your form.
function form_onLoad(executionContext){var formContext = executionContext.getFormContext();formContext.data.process.addOnPreStageChange(preStageChange);formContext.data.process.addOnPreStageChange(AddStageChange);}function preStageChange(executionContext) {var direction = executionContext.getEventArgs().getDirection();if (direction == "Previous") {// ***Xrm.Utility.alertDialog("This is an automatic Process, the Button is not allowed");// ***executionContext.getEventArgs().preventDefault();}}function AddStageChange(executionContext) {var direction = executionContext.getEventArgs().getDirection();if (direction == "Next") {Xrm.Utility.alertDialog("Your customized messge.");executionContext.getEventArgs().preventDefault();}}
Hi Yazid
Your code works great; however, it is all or nothing.
I've been trying to work out how to make it conditional (e.g., only run if something on the form is true/false).
It's a syntax issue that is escaping me!
Thanks
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 Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2