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

Notifications

Announcements

No record found.

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 Super User 2025 Season 2 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans