Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to remove Close as Won and Close as Lost options in opportunity for some specific users?

(0) ShareShare
ReportReport
Posted on by 347

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

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,076 on at
    RE: How to remove Close as Won and Close as Lost options in opportunity for some specific users?

    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.

  • waleedbinafzal Profile Picture
    waleedbinafzal 347 on at
    RE: How to remove Close as Won and Close as Lost options in opportunity for some specific users?

    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.

  • Suggested answer
    sandeepstw Profile Picture
    sandeepstw 4,601 on at
    RE: How to remove Close as Won and Close as Lost options in opportunity for some specific users?

    Hi,

    Please check these links below -

    community.dynamics.com/.../how-to-disable-a-crm-2016-ribbon-button-based-on-form-name

    garethtuckercrm.com/.../dynamically-disable-ribbon-buttons-in-dynamics-crm

  • Verified answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,076 on at
    RE: How to remove Close as Won and Close as Lost options in opportunity for some specific users?

    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.

  • Verified answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: How to remove Close as Won and Close as Lost options in opportunity for some specific users?

    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

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,971 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans