We have a requirement to assign both Technical and Business users to each application in order to complete technical and business data. It is important that both types of users are not allowed to edit each other's data. To fulfill this requirement, we used an Access Team Template that allows us to assign specific users with access to the application. Our process involved:
However, we have encountered an issue where Business users are able to add data to the Subgrid on the Technical page. This is problematic because only Technical users are allowed to edit the value of the Subgrid on the Technical page. We need to ensure that non-technical users are not able to add existing data to the Subgrid.
how we can hide the 'Add Existing..' button for the Subgrid on the technical page for non technial users.
Hi SivaR,
Hope you are well.
Here are the steps to hide the 'Add Existing...' button for the Subgrid on the technical page for non-technical users.
1. Download Ribbon Workbench: Develop 1 Ltd | Ribbon Workbench for Dynamics 365 & Dynamics CRM
2. Select the environment that you want to hide the 'Add Existing...' button for the Subgrid.
3. Go to Advanced Settings > Solutions > Import > Choose the file we download.
4. Find non-technician's security role GUID and then enter in js code to hide 'Add Existing...' button.
5. Go to Advanced Settings > Customizations > Customize the system > Web Resource > create a new Web Resource
function hideButtons(){
var value = true;
var basicuserGuid = "70110B17-CCE0-ED11-A7C6-000D3A35619A";
var userRoles = Xrm.Utility.getGlobalContext().userSettings.securityRoles;
for (var i = 0; i < userRoles.length; i++) {
if (userRoles[i].toUpperCase() == basicuserGuid.toUpperCase()){
value = false;
break;
}
}
return value;
}
6. Create a new solution and add form that you want to hide the button.
7. Go to Advanced Settings > Solutions > Click Ribbon Workbench
8. Click 'Add Existing...' button and create an enable rule.
9. Save and Publish.
You can also refer to this link: Hide show button on security role using JavaScript and ribbon workbench Dynamics 366 or Dataverse | Softchief Learn
Best Regards,
Sayen Zhang
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.