Notifications
Announcements
No record found.
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
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.
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.
Still, if you wanted to do something about "deactivate" button, the thread below might be useful:
community.dynamics.com/.../152982
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.
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
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2