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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to get current tabs Name

(0) ShareShare
ReportReport
Posted on by 120

I need to check the current tab's name (the on I click on) and according to that to run some functionality, how do I find a tab's name?

(working on 36 on-premise uci)

I have the same question (0)
  • Suggested answer
    NODAL Profile Picture
    860 on at

    Hi damka,

    You can try below piece of code.

    let currentTab="";

    formContext.ui.tabs.forEach(tab=>{

       if (tab.getDisplayState() === "expanded") {

           currentTab = tab.getLabel()

       }

    }

    )

    Thanks,

    Ketan

  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    You can add below function on form load of any entity:

    function getAllTabs (executionContext) {
            'use strict';
            var formContext = executionContext.getFormContext();
            var tabs = formContext.ui.tabs.get();
    	// all tabs
            for (var i = 0; i < tabs.length; i  ) {
    
    	    if(tabs[i].getLabel() === "")
                {
                       //add your logic here
    
                 //for section only: -get all sections
                var sections = tabs[i].sections.get();
                for (var j = 0; j < sections.length; j  ) {
                    var controls = sections[j].controls.get();
                   //add your logic here
                }
    
              }      
               
            }
        }

  • Suggested answer
    Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Hi,

    Please check out this link: learn.microsoft.com/.../getdisplaystate

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Moderator on at

    Hello User,

    Please check out below article which will help you to implement your requirement on Tab change, let me know if you need more information or facing any issue during implementing it.

    www.crmcrate.com/.../

    Thank you,

    Amit Katariya

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!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 180 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans