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)

Is there a permission for Deactivate Record?

(0) ShareShare
ReportReport
Posted on by

I know we can prevent users from deleting records in security roles, but is there a way to control if they have the ability to deactivate them?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Permissions to activate/deactivate records are controlled with "Update" permission so if user has privileges to update record he/she has privileges to activate/deactivate record.

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

    No, there is no particular permissions to deactivate records.

    You can use ribbon workbench to restrict deactivation by hiding the Activate/Deactivate buttons using privileges.

    Below is a link to an article on how to do this. The article uses the older version of Ribbon Workbench, but the logic is the same.

    Hope this helps.

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Still, if you wanted to do something about "deactivate" button, the thread below might be useful:

    community.dynamics.com/.../152982

  • Verified answer
    Community Member Profile Picture
    on at

    Hi,

    if the user has the write privilege, he can deactivate the record.

    You could avoid that by disabling the deactivate button with the help of the RibbonWorkBench, if the user is not a system admin.

  • Verified answer
    Aman Anvaria Profile Picture
    306 on at

    Hi CRM Learner 8,

    Security Role does not provide access levels/permisssions over DEACTIVATION/ACTIVATION, so you can not achieve this in straight forward way, best option is to control visibility of DEACTIVATE button on form using ribbon workbench.

    Please try the below code, it may help:

    function controlvisibility()

    {

    var username = Xrm.Page.context.getUserName();

    var userid = Xrm.Page.context.getUserId();

    var ownerlookup = Xrm.Page.getAttribute("ownerid").getValue();

    var recordownerID = ownerlookup [0].id;

    var recordownerName = ownerlookup [0].name;

    if(userid == recordownerID)

    return true;

    else

    return false;

    }

    Use this code as Enable Rule.

    In above code Deactivate button is only visible to owner of record.

    Thanks and Regards,

    Aman Anvaria

  • Verified answer
    Community Member Profile Picture
    on at

    Hi,

    you could als create a preDeactivation plugin checking the roles of the users and if the user hasn't the rights privileges, you simply throw an error and abort the deactivation.

    It will then work from all over CRM, i.e. form, views, advance finds,...

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