Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Locking/Disable a stage in BPF

Posted on by 140

Is there any way to lock/Disable a certain stage in BPF using javascript. Thanks!

  • Prima Kid Profile Picture
    Prima Kid 55 on at
    RE: Locking/Disable a stage in BPF

    Hello Leo Zhang,

    Thank you for your idea and suggestion.

    pastedimage1587975080442v2.png

    Here copy of my code:

    function disableStage(){
        var stageObj=document.getElementById("stage_15");
        stageObj.classList.add("disabled");
    }

    I have a needs to disabled stage using JavaScript Code too, and I try using your suggestion. But I got error message, but this is general error message.

    pastedimage1587974929616v1.png

    I think the code of document.getElementById is not support.

    I used Dynamics 365 with Microsoft Dynamics 365 Version 1612 (9.0.2.3034) (DB 9.0.2.3034) on-premises.

    Kindly advice and help.

    Thank you in advance! 

    Regards,

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Locking/Disable a stage in BPF

    Hi partner,

    After my tests, I found that the key to stage status icon presence is the class name and the locked icon corresponds to "disabled" class.

    So if you only want to add a locked icon to a stage, you could use the following code.

    function disableStage(){
        var stageObj=document.getElementById("stagedivId");
        stageObj.classList.add("disabled");
    }

    Note: You should replace the "stagedivId" with your stage Div id which could be found through F12 development tools.

    This method needs to be used in conjunction with your business logic. When you've identified the stage you want to lock, call this code.

    community445.png

    Hope it helps.

    Best Regards,

    Leo

  • GPrasanna Profile Picture
    GPrasanna 140 on at
    RE: Locking/Disable a stage in BPF

    I'm sorry, I should have been more specific. I am looking for something as below

    StageLock.PNG

  • Suggested answer
    Haris Lilic Profile Picture
    Haris Lilic 125 on at
    RE: Locking/Disable a stage in BPF

    I have had similar requirements to this and the way we approached it was by using field level security on the fields inside that stage. If you make the fields required and apply field level security to them, then users who are not apart of that field level security profile will not be able to enter data, and also won't be able to move to the next stage since there are required fields that have not been filled out yet.

    Hope this helps! :)

  • GPrasanna Profile Picture
    GPrasanna 140 on at
    RE: Locking/Disable a stage in BPF

    Thank you for the response. I am aware of restricting the user by moving to the next stage or can even disable the fields. we have required fields on the stage which doesn't allow user to move before completion. My requirement is just to let the user know by showing a locked symbol that they are not supposed to enter anything on that stage.This is kind of UI requirement. 

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Locking/Disable a stage in BPF

    Hi partner,

    Unfortunately, we could not lock/disable a stage by JS.

    If you really want this function, you could refer to Priyesh Wagh's answer in the following post. He suggested to use custom plug-in to prevent user going to a certain stage with C#.

    https://community.dynamics.com/365/customerservice/f/763/t/319795

    In addition, could you share your business requirement so that we could think other solutions to help you.

    Hope it helps.

    Best Regards,

    Leo

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans