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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156