Hello Everyone,
I would like to know that is there any way to disable back button present on Business Process Flow for any entitiy. Is it possible with Javascript and how?
Regards,
Deepak
*This post is locked for comments
Hello Everyone,
I would like to know that is there any way to disable back button present on Business Process Flow for any entitiy. Is it possible with Javascript and how?
Regards,
Deepak
*This post is locked for comments
Hi, I also had this requirement, this blog post helped me a lot, it uses the Xrm library, so it should be future compatible.
Here is the code I used:
function hidePreviousStageButton(executionContext) { var formContext = executionContext.getFormContext(); var process = formContext.data.process; //handles changes to the BPF before they actually occur process.addOnPreStageChange(myProcessStateOnPreChange); } function myProcessStateOnPreChange(executionContext) { var formContext= executionContext.getFormContext(); var process = formContext.data.process; var eventArgs = executionContext.getEventArgs(); var currentStageId = process.getActiveStage().getId(); var nextStageId = process.getSelectedStage().getId(); //dont allow to go back using the set active button if (currentStageId != nextStageId) { eventArgs.preventDefault(); Xrm.Utility.alertDialog("You cannot use the Set Active button.") return; } if (eventArgs._direction === 1) //backwards { //here you can add logic based upon the BPF going to the previous Stage. return; } //otherwise forward // here you can add logic based upon the BPF going to the next Stage. }
Its a business requirement, where only the highest ranking BD leader can click finish after reviewing
What's the requirement behind hiding the Finish button, if I may know.
Francesco, do you have an update for this solution that works with the new Unified Interface? Thanks
Hi Francesco,
I'm trying to do exactly the same thing (hide the finish button) on a BPF! I'm quite new to using code in Dynamics so excuse my ignorance, but what do you do with this code/where do you put it?
Thanks in advance!
Olly
Yes, it is but ... it's the only solution :-)
This is unsupported, though:)
This is the code i used to hide "Finish" button of Business Process Flow, please substitute the id with the id of the button you want to hide:
var hide = true; var interval = null; function OnLoad(){ interval = setInterval(function () { var element = parent.document.getElementById("stageFinishActionContainer"); if (element != null && hide == true) { hide = false; element.style.display = "none"; clearInterval(interval); } }, 1000); }
If you found the answer helpful, please mark as Verified
Thank you & Best Regards
Francesco Picchi
Microsoft Dynamics CRM Consultant, Bologna, ITALY
Independent Contractor
Hi Deepak,
Just check the below link.
community.dynamics.com/.../224235
It might helpful.
Thanks,
Jagannath
André Arnaud de Cal... 291,405 Super User 2024 Season 2
Martin Dráb 230,455 Most Valuable Professional
nmaenpaa 101,156