web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to Control Access to Reopen Opportunity?

(0) ShareShare
ReportReport
Posted on by

When opportunities are Closed as Won they are locked down.  There is a button on the ribbon that allows us to reopen them though if need be.

Is there a way to control who has access to this button?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi,

     Pretty sure you can use ribbon workbench for this:

    ribbonworkbench.uservoice.com/.../76681-hide-a-standard-out-of-the-box-button-based-on-a

  • CRM Learner 88 Profile Picture
    on at

    This would allow to appear just for users we want it to?

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    You might create a new custom entity and a security role that will allow, let's say, "Delete" on that entity.. The you can assign that role to the users who are supposed to have access to the button. Then you can follow the link above to only display that opportunity button for the users who have "Delete" permission on that custom entity

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    You can also create an edit rule, that will call a JavaScript function.

    The JavaScript function can check the security role of the logged in user, and based on that security role name, set it to either be visible or not.

    Check Ribbon Workbench enable rules (custom rule), Xrm.Page.context.getUserRoles(), and create a function is user in role to check if the user is a member of a particular role that you would designate for this purpose.

    Hope this helps.

  • Verified answer
    Syed Ibrahim Profile Picture
    6,257 on at

    You can follow Mr.Alex's suggestion.pls follow below for that approach.

    [View:https://www.powerobjects.com/2016/05/17/solving-security-headaches-display-rules-based-on-security-roles/]

    If You want show and hide the Button for specific role or user using is then follow below.

    function getUerRoles()

    {

    var roleid = Xrm.Page.context.getUserRoles();

    var name;

    for (var i = 0; i < roleid.length; i++) {

    var roleID = roleid[i];

    var RoleName = getRoleName(roleID);

    if (RoleName == 'System Administrator') {

    return true;

       }

    else

       {

    return false;

    }

    }

    }

    function getRoleName(roleID) {

    var serverUrl = Xrm.Page.context.getClientUrl();

    var OdataURL = serverUrl + "/XRMServices/2011/OrganizationData.svc" + "/" + "RoleSet?$filter=RoleId eq guid'" + roleID + "'";

    var roleName = null;

    $.ajax({

    type: "GET",

    async: false,

    contentType: "application/json; charset=utf-8", datatype: "json",

    url: OdataURL,

    beforeSend:

    function (XMLHttpRequest) {

    XMLHttpRequest.setRequestHeader("Accept", "application/json");

    },

    success:

    function (data, textStatus, XmlHttpRequest) {

    var result = data.d;

    roleName = result.results[0].Name;

    },

    error:

    function (XmlHttpRequest, textStatus, errorThrown) {

    // alert('OData Select Failed: ' + odataSelect);

    }

    });

    return roleName;

    }

    Hope this helps.

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    I had the similar requirement but in my case I wanted to display an error message to the user if he doesn't have the right access. I managed to achieve this by adding a new field on the user entity "Advanced Opportunity Access" and then create a real time workflow which trigger on change of status.

    Within the workflow, I check if the modified by (user) has that field check r not. If not, stop the workflow as cancelled (with error message).

    If you wish, you can also have the same implementation and if required instead of having a field on the user entity, you can simply add a direct check within the real time workflow i.e. if modified by (user) = 'Some User' then throw error.

    Hope this helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans