Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Dynamically show/hide Tabs on form based on field value without JavaScript - Using standard features and functions in D365?

(0) ShareShare
ReportReport
Posted on by 135

Is it possible to show and hide Tabs on a form based on field value without the use of JavaScript?

Lets say we hava form with 3 tabs: General, Info, Other. (Each tab has many fields and sections)

On General tab we have a field for "Show Info Tab" with Yes/No options.

If Yes the tab "Info" is visible 

If No the tab "Info" is hidden completely. Not just fields and sections but also the tab name on top of the form.

I know this is possible using JavaScript, but now late in 2020 - is there any new method one could use with standard features or functions in Dynamics 365

  • TGT Profile Picture
    TGT 135 on at
    RE: Dynamically show/hide Tabs on form based on field value without JavaScript - Using standard features and functions in D365?

    Yeah, that's what i already figured out. Was worth a shot anyway.

    Solved using a small JavaScript something like this:

    function showHideTabs(executionContext) {
    	var formContext = executionContext.getFormContext();
    	var xxxfieldNamexxx = formContext.data.entity.attributes
    		.getByName("FIELDNAME")
    		.getValue();
    		
    	if (xxxfieldNamexxx) //true
    	{
    		formContext.ui.tabs.get("TAB NAME").setVisible(true);
    	} else(!xxxfieldNamexxx); //false
    	{
    		formContext.ui.tabs.get("TAB NAME").setVisible(false);
    	}
    }

  • Suggested answer
    Ran Zhang Profile Picture
    Ran Zhang on at
    RE: Dynamically show/hide Tabs on form based on field value without JavaScript - Using standard features and functions in D365?

    Hi,

    I don't think we have standard feature supporting hiding tabs based on field value. I thought about Business Rules, Workflows, etc, but neither of them has this functionality. Please check the official doc https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/visibility-options-legacy. By the way, it's very easy to use JS to achieve your requirement, please reconsider the operation. Thanks.

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! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans