web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Show hide tab based on user guid....

(0) ShareShare
ReportReport
Posted on by 26

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)
  • Verified answer
    USA80 Profile Picture
    26 on at

    I got it working.  The user id for the letters needed to be in CAPS, as that is how the debugger was picking it up.

  • Suggested answer
    Shidin Haridas Profile Picture
    3,499 on at

    Change both sides of the equations to lowercase, and also remove the curly braces,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans