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)

Restricting BPF to go backward

(0) ShareShare
ReportReport
Posted on by 1,299

Hi,

Is there a way of restricting BPF to move backwards. Which is the user should not be able to go to the previous stage and should only be able to move forward.

Thanks.

*This post is locked for comments

I have the same question (1)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Davjones,

    There is no default way to achieve your functionality. You have to write custom business logic using plugin or custom workflow to achieve it.

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi DavyJones,

    Please refer the link below.

    debajmecrm.com/.../prevent-user-from-moving-to-previous-stage-in-crm-2013-business-process-flows

    It describes how to prevent the user from moving to the previous stage in CRM 2013 Business Process Flows using Javascript code on-load of the form.

  • Davyjones Profile Picture
    1,299 on at

    HI Nithya,

    Thanks for your response, i tried this and when the form loads it throws an error that its undefined, i tried debugging the Jscript and its in "$(“#stageBackActionContainer”).hide();" stating "Uncaught SyntaxError: Invalid or unexpected token". Please help

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi DavyJones,

    If you have copied the code as itself, the double quotes used may be a problem behind this syntax error. Please copy the following code.

    function hidePreviousStageButton(stageBackActionContainer, stageAdvanceActionContainer) {
    $("#stageBackActionContainer").hide();
    $("#stageBackActionContainer").html("");
    $("#stageAdvanceActionContainer").css("width", "90px");
    }
  • Davyjones Profile Picture
    1,299 on at

    Hi Nithya,

    This is exactly how i have the jscript, not sure whats wrong, should i be passing any parameters in the Jscript to execute?

    Thanks for your time

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi,

    Can you now try the following code to check if it is working?

    function restrictBPFPreviousMove() {
       
            var originalPreviousStageHandler = $("#stageBackActionContainer").data("events")["click"][0].handler;
            $("#stageBackActionContainer").unbind("click");
            $("#stageBackActionContainer").click(function (e) {
                alert("Restricted Back Move!");
            });
    }
  • Davyjones Profile Picture
    1,299 on at

    Hi Nithya,

    Thank you very much for your efforts, I tried the code above and i am getting an error "Unable to get property "Click" of undefined or null reference. Should i be including any libraries for this to work.

    Thanks again for your help

  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Try the code below. 

    $("#stageBackActionContainer").on("click",function (e) {
                alert("Restricted Back Move!");
            });
  • Davyjones Profile Picture
    1,299 on at

    Hi Nithya,

    This time the error just says "undefined", i tried debugging the code after the debugger enters the first line its calling the exception.

    Thanks

  • hellosuresh Profile Picture
    539 on at

    Open the developer tools (F12) and try to find the button and make css display to none. If that works, find the id of Back button and try to hide using jquery.

    I'm using following code to hide back button in Dynamics CRM 2013 on-premise

     $('#stageBackActionContainer').hide();

           $('#stageBackActionContainer').html('');

           $('#stageBackActionContainer').css('width', '0px');

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