Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Hide Section or Tab

(0) ShareShare
ReportReport
Posted on by 220

Hi Guys,

Is there such a business rule where I could hide Section(s) or Tab(s) depending on fields value.

Thanks

*This post is locked for comments

  • Suggested answer
    Vipin J Profile Picture
    1,583 on at
    RE: Hide Section or Tab

    I have created some Generic Method to Hide and Show Tab and Section

    Please refer here : https://vjcity.blogspot.com/2021/07/generic-method-to-hide-and-show-tab-and.html

  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at
    RE: Hide Section or Tab

    you need to add this code on form load and field option set change.

    Create JavaScript function with parameter as option set value, and add logic to show / hide based on option set.

    call this function on form load and pass option set value.

    also call this function on option set value change so that tab/ section will be shown / hidden.

  • Rasi Profile Picture
    220 on at
    RE: Hide Section or Tab

    Thanks for you reply, Where would I put the field Value? I have many sections/tabs but I only want to display if field option set = required option.

  • Suggested answer
    Nicholas C Profile Picture
    55 on at
    RE: Hide Section or Tab

    Rasi, no there is not a business rule for this in CRM that i am aware of.

    You could apply JS logic to hide a particular section in CRM easily depending on your fields value on the CRM form. Here is essentially a function that you can use in CRM. You can pass the sectionname, and then the visibility choice in order to show or hide your desired section.

    function ViewFormSection(sectionname, visibility) {

       var tabs = Xrm.Page.ui.tabs.get();

       for (var i in tabs) {

           var tab = tabs[i];

           tab.sections.forEach(function (section, index) {

               if (section.getName() == sectionname) {

                   section.setVisible(visibility);

               }

           });

       }

    }

  • Suggested answer
    gdas Profile Picture
    50,089 Moderator on at
    RE: Hide Section or Tab

    Unfortunately you can not hide section  tab using business rules. You need to write JavaScript for that as suggested above.

  • Suggested answer
    Mahadeo Matre Profile Picture
    17,021 on at
    RE: Hide Section or Tab

    Hi Rasi,

    You cannot create business rule to show or hide sections / tabs.. but you can write JavaScript to show / hide sections and tab from form.

    TO show /hide tabs

    formContext.ui.tabs.get("tabname").setVisible(true); //to show

    formContext.ui.tabs.get("tabname").setVisible(false); //to hide

    more details

    docs.microsoft.com/.../formcontext-ui-tabs

    and for sections

    var tabObj = formContext.ui.tabs.get("tabname");

    var sectionObj = tabObj.sections.get("sectionname");

    sectionObj.setVisible(true); //to show

    sectionObj.setVisible(false); //to hide

    more details

    docs.microsoft.com/.../formcontext-ui-sections

    Hope this will help..

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,001 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,833 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans