I have a scenario in which custom button should be hide and show as per security role and status reason.
I have a scenario in which custom button should be hide and show as per security role and status reason.
Hello,
Yes, you can handle this scenario with a custom rule using JavaScript !
function IsUserHasRoles() { // GUID of role to check var roleId = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"; // Get all the roles of the Logged in User. var currentUserRoles = Xrm.Utility.getGlobalContext().userSettings.securityRoles; for (var i = 0; i < currentUserRoles.length; i ) { var userRoleId = currentUserRoles[i]; if (userRoleId == roleId) { // Return true if the Role matches return true; } } return false; }
Mehdi,
Hello,
Check the below links:
1. Show/Hide button based on security role (applied for system and custom buttons): www.powerobjects.com/.../
2. Show/Hide button based on status reason: community.dynamics.com/.../358240
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Vahid Ghafarpour
78
Super User 2025 Season 1
Muhammad Shahzad Sh...
72