Hi Everyone,
I am trying to Load a tab based on the Security role. Can anyone please help?
I tried using the below code on the form onLoad but no luck.
Can anyone please correct me?? or provide a better solution.
For below code; i used onload function "leadFormCustomization.customEditAccess"
var leadFormCustomization = {
customEditAccess: function (execContext) {
debugger;
var formContext = execContext.getFormContext();
var userSettings = Xrm.Utility.getGlobalContext().userSettings;
//Get Security Roles of the current User
var securityRoles = userSettings.securityRoles;
//Below is the GUID of the Security Role "CustomEditAccess"
var securityRoleId = "7b54873B06-A234-EA11-A812-000D3A53014B";
for (i = 0; i < securityRoles.length; i ) {
//If current User contains the Required Security Role
if (securityRoles[i].toUpperCase() == securityRoleId.toUpperCase()) {
Xrm.Page.ui.tabs.get("tab_2").setFocus()
}}}}
Thank you in advance.