Hi,
I have a requirement to remove the option of Close as Won and Close as Lost options from Opportunity for some users. There are few users that use our CRM and company wants just to allow them to add opportunity or to edit opportunity. They don't want to allow them to close or lost the opportunity on their own.
I want to know how it can be done? Is there anyway to do this? Any help or suggestion would be highly appreciable.
Thanks.
*This post is locked for comments
Hi,
You can create a custom Javascript webresource which checks the logged in user and if the user is specific user (eg: admin), return true (which means the button will be visible?) else false to hide the button according to your requirements. Add this JavaScript webresource along with the opportunity entity to a solution and open this solution in ribbon workbench. Right click the button you need to customize and select Customize Command. In th display rules section, add a new custom rule and give the JavaScript function in your custom Javascript webresource which decide whether to show or hide the button (true of false returned from JS function).
See: community.dynamics.com/.../178915
In the link above, it is getting the current user security roles.
You can get the current userId in javascript using the code below.
Xrm.Page.context.getUserName();
Hope this helps.
Hi Nithya,
I have gone though this link, but the problem is it is not telling how I can hide these options for a specific user with respect to security role? I mean, if I have a user having the security role as for eg: admin, then how can I apply the customization to this security role?
Infact all the solutions given above, all have the same problem. They are not showing how i can relate it to a specific user or a specific security rule.
Hi waleedbinafzal,
You can use Enable rules or Display rules to show/hide the Close as Won and Close as Lost buttons using Ribbon workbench.
See: www.powerobjects.com/.../solving-security-headaches-display-rules-based-on-security-roles
Hope this helps.
Hi,
You can hide these ribbon buttons based on some logic for example you can create a specific security role which you can assign to these setup of users and than can hide it based on their security role or can use specific entity privileges .
Please follow steps here: ribbonworkbench.uservoice.com/.../76681-hide-a-standard-out-of-the-box-button-based-on-a
André Arnaud de Cal...
291,971
Super User 2025 Season 1
Martin Dráb
230,846
Most Valuable Professional
nmaenpaa
101,156