Dear Community,
I've been try to hide 'Export to Excel' button on Account Entity for some users. That user shouldn't have access to export to excel only on Account Entity.
Export to Excel is hiding ok for the HomePageGrid.
but if the user is selected one or more record, it is showing again.
Is there a way to hide 'Export to Excel' even when a record is selected?
I've been tried SelectedControlSelectedItemCount on CRM parameter but no luck.
Here is my code.
function getCurrentUserSecurityRole_CustomerAccess()
{
debugger;
var value=true;
var userRoles=Xrm.Utility.getGlobalContext().userSettings;
if(Object.keys(userRoles.roles._collection).length>0)
{
for ( var rolidcollection in userRoles.roles._collection)
{
var currentUserRoles= Xrm.Utility.getGlobalContext().userSettings.roles._collection[rolidcollection].id;
//if user doesn't have access to 'Export to Excel' for Account Entity
if(currentUserRoles.toLowerCase()==/8d1657c6-3e21-ee11-9cbe-6045bd57c806/)
{
value=false;
break;
}
}
}
return value;
}