Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Restrict who can 'Close as Won' within Opportunities

Posted on by 375

I'm looking for a way I can restrict certain users from closing an opportunity as won. Ideally I would like a small amount of users who can close any given opportunity as won.

I can use JavaScript to get the User's ID etc to use but seriously stuck for ideas. I understand that you can prevent the user from saving the opportunity which isn't what I'm after.

I would like a user to be able to fill out the form, save it which will trigger a workflow and send an email to their manager who can then approve the opportunity and then 'Close as Won' but need to prevent anyone else doing this.

Any feedback would be kindly appreciated. :-)

*This post is locked for comments

  • Jamie Bassett Profile Picture
    Jamie Bassett 375 on at
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Scott,

    No problem.. thank you for replying so quickly. I wrote the other message to Bojan before I received your answer.

    I will now go through this and give it a go. Thanks for your patience and useful suggestions for my issues.

    Kind Regards,

    Jamie

  • Jamie Bassett Profile Picture
    Jamie Bassett 375 on at
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Bojan,

    Thank you for the response. I understand how I can modify the ribbon for users dependent on the permissions but my issue is the enabling/disabling of the 'Close as Won' button whilst the form is open.

    ANYONE can use the 'Close as Won' button on form load UNLESS a particular checkbox on the form is checked and THEREFORE the button becomes disabled for all users other than a specific group using the Security Permissions.

    So.. what I really need is the 'Close as Won' button to become disabled (for all users other than those with correct security roles) which I don't think can be done dynamically. I can see this somehow working but the form would need to be re-loaded in order for the ribbon to change to the custom ribbon and any changes to the form may be lost on re-load as well as the process not even working because of business required fields not filled in etc.

    I hope I've made this clear as both you guys are explaining exactly what I need to do for a part of this process but the real thing I'm stuck with is how the ribbon/form will change dynamically depending on whether a box is checked and the users security permissions are correct.

    In terms of checking the users role, I can do this without any issues and I can use your tutorials to have a custom ribbon but I need this to be customised dynamically using form conditions.

    Thank you

  • Suggested answer
    ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Jamie,

    Sorry, I see what you mean.

    You'll need to add some EnableRules with ValueRules to check the value of the field as well. Although this is called an Enable Rule, in CRM2013 when a button is disabled it is actually hidden!

    I wrote I tutorial on how to use ValueRules - ribbonworkbench.uservoice.com/.../121427-enable-disable-a-ribbon-button-dynamically-based-o

    Again this will work for CRM2013.

    Hope this helps,

    Scott

  • Verified answer
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Jamie,

    To achieve what you need, you will need to use a custom enable or display rule.

    If the manager who received the email can only click the Save as won button, then you would need a Javascript function that will check if the current user is the user that received the email (I am supposing you have this user somewhere on the opportunity form or to a related entity).

    You should then create a custom enable rule, with the created function and apply the rule to the button through the way Scott described or through customization XML, like on the following link.

    www.powerobjects.com/.../add-custom-rules-for-ribbon-buttons-javascript-crm-2011

    Hope it helps,

    Bojan.

  • Jamie Bassett Profile Picture
    Jamie Bassett 375 on at
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Scott,

    The technique you use will only restrict the button from being shown using permissions. As I tried to explain in my scenario is that 'Any' user can use the 'Close as Won' button providing that a certain field on the form isn't checked. But.. if that field is checked then only those with the correct permissions will be able to use the button. So this solution would work for part b of the issue but my real struggle is how you would determine whether the 'Close as Won' button is shown for EVERYONE unless a certain field is checked?

    Thanks Again

  • Jamie Bassett Profile Picture
    Jamie Bassett 375 on at
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Scott,

    I understand your instructions and that would work in a given scenario but mine is 'slightly' different.

    Scenario:

    I have a form which 'ANY' user can fill out..

    I want the 'CLOSE AS WON' button to be hidden/disabled 'IF' a certain field contains a value or a box is checked etc.

    So..

    A basic form has a number of field values. If (x) field contains 'Joe Bloggs'.. Show the 'Close as Won' button else hide the button.

    Or.. If box is checked, show button else hide it.

    In brief, Once a form has been filled out by a user, the Manager will receive an e-mail from a workflow. On this form their will be a field which will be either yes or no. If the field equals no.. the user can close the form themselves but if the field is yes, they will need the managers approval and can't close the form themselves. The manager will then go onto the form, add their name to the 'Approval' field and/or tick a box if it can be closed or not. If the field and/or box has been filled and the form is saved.. the user or the manager can then close the form as won.

    The issue with changing the ribbon to only show a button to certain members using security roles will have a restriction on members regardless if a field is 'yes or no' as the ribbon wouldn't update dynamically based on a field value.

    Really appreciate your time, Thanks again.

  • Suggested answer
    ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Jamie,

    The instructions are shown using CRM2011 but they work also for CRM2013.

    Hope this helps,

    Scott

  • Jamie Bassett Profile Picture
    Jamie Bassett 375 on at
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Scott

    Firstly thanks for the prompt reply.. Can you do this process in CRM 2013 because as far as I'm aware those instructions are aimed towards CRM 4?

    Thanks

  • Suggested answer
    ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Restrict who can 'Close as Won' within Opportunities

    Hi Jamie,

    You could create a dialog that is run by a user to request the approval that sends an email, then restrict pressing the close as won button using security roles using the technique I describe here - ribbonworkbench.uservoice.com/.../76681-hide-a-standard-out-of-the-box-button-based-on-a

    Hope this helps,

    Scott

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans