I have the following JavaScript setup to grab the users guid and then show/hide a tab on a form. However, even though I go through the debugger (hitting f12), it does pick up the user id which does match Kevin's below, it still hides the tab when it should be showing it. Am I doing something wrong?
function UserShowHideOnLoad()
{
// Obtain the User Id from context of the page.
var userId = window.parent.Xrm.Page.context.getUserId();
// Check for user Id match
if (userId == "{c06a6ce4-942f-e011-8bb5-1cc1def1e4a9}" // User – Lisa
|| userId == "{3faa4d2a-2fe6-e111-9709-0050568c0023}" // User – Laura
|| userId == "{d3744355-f874-e611-80e9-005056a15f01}" // User – Kevin
)
{
// Use setVisible(true) to DISPLAY section
Xrm.Page.ui.tabs.get("tab_DataServicesTeam").setVisible(true);
}
else
{
// Use setVisible(false) to HIDE section
Xrm.Page.ui.tabs.get("tab_DataServicesTeam").setVisible(false);
}
}
*This post is locked for comments
I have the same question (0)