web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Hide BPF Next button in Unified interface

(2) ShareShare
ReportReport
Posted on by 245

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

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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.

  • gdas Profile Picture
    50,091 Moderator on at

    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 ?

  • Benjamin Fallar III Profile Picture
    245 on at

    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.

  • Benjamin Fallar III Profile Picture
    245 on at

    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.

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at

    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.

    ScreenClip-_5B00_609_5D00_.png

  • Yazid  Profile Picture
    25 on at

    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

  • shaikh sharef Profile Picture
    80 on at

    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 

  • Suggested answer
    Yazid  Profile Picture
    25 on at

    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();
    }

  • donalmc Profile Picture
    125 on at

    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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans