Is there any way to lock/Disable a certain stage in BPF using javascript. Thanks!
Is there any way to lock/Disable a certain stage in BPF using javascript. Thanks!
Hello Leo Zhang,
Thank you for your idea and suggestion.
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.
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,
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.
Hope it helps.
Best Regards,
Leo
I'm sorry, I should have been more specific. I am looking for something as below
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! :)
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.
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156