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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Get the Selected Tab page from the current form

(0) ShareShare
ReportReport
Posted on by 92

Hello,

I have a subgrid that is found in the same entity twice, but I need to put an enable rule so that new and add existing are hidden on "Job description."
I am trying to create a custom enable rule using js to hid the fields on this specific tab. I am trying to get the name of the current page were the user selected to be able to return true and false values based on it.

I can't find a way to get the current selected tab using javascript.

Thank you!

I have the same question (0)
  • Suggested answer
    KK-365 Profile Picture
    1,010 on at

    Hi Mbaba,

    Please find below the sample script. Hope this will help you to configure.


    function showHideDescriptionTab(formContext) {
    switch (formContext.getAttribute("casetypecode").getValue()) {
    case 1:
    formContext.ui.tabs.get("Description").setVisible(true);
    formContext.ui.tabs.get("Incident_Details").setVisible(false);
    break;
    case 2:
    formContext.ui.tabs.get("Incident_Details").setVisible(true);
    formContext.ui.tabs.get("Description").setVisible(false);
    break;
    default:
    formContext.ui.tabs.get("Description").setVisible(false);
    formContext.ui.tabs.get("Incident_Details").setVisible(false);
    }
    }

    If you find this answer helpful, please mark it verified.

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 49 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
#ManoVerse Profile Picture

#ManoVerse 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans