Skip to main content

Notifications

Announcements

No record found.

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!

  • Suggested answer
    KK-365 Profile Picture
    KK-365 1,010 on at
    RE: Get the Selected Tab page from the current form

    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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,622 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans