Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Hide/Disable back button from Business Process Flow

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

  • Suggested answer
    ManelPereira98 Profile Picture
    ManelPereira98 5 on at
    RE: Hide/Disable back button from Business Process Flow

    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.   
    }
    Hope it helps!
  • LeIfe Profile Picture
    LeIfe 10 on at
    RE: Hide/Disable back button from Business Process Flow

    Its a business requirement, where only the highest ranking BD leader can click finish after reviewing

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Hide/Disable back button from Business Process Flow

    What's the requirement behind hiding the Finish button, if I may know.

  • LeIfe Profile Picture
    LeIfe 10 on at
    RE: Hide/Disable back button from Business Process Flow

    Francesco, do you have an update for this solution that works with the new Unified Interface? Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Hide/Disable back button from Business Process Flow

    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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Hide/Disable back button from Business Process Flow

    Yes, it is but ... it's the only solution :-)

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Hide/Disable back button from Business Process Flow

    This is unsupported, though:)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Hide/Disable back button from Business Process Flow

    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

    http://www.francescopicchi.com

  • Suggested answer
    Jagannath Profile Picture
    Jagannath 545 on at
    RE: Hide/Disable back button from Business Process Flow

    Hi Deepak,

    Just check the below link.

    community.dynamics.com/.../224235

    It might helpful.

    Thanks,

    Jagannath

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,405 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,455 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans