Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Hiding fields across tabs in the same form.

Posted on by 100

Complex-Business-Rule.pngWhat is the most efficient way to hide fields across tabs in the same form?

Business Rules Screen gets too complex as the number of fields increase.

Please help, thanks.

*This post is locked for comments

  • Suggested answer
    Kalpavruksh D365 CoE Profile Picture
    Kalpavruksh D365 CoE 2,545 on at
  • Suggested answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: Hiding fields across tabs in the same form.

    Hi KashyapT,

    It would be better to create js in case of multiple if conditions.

    Xrm.Page.ui.tabs.get("tabName").sections.forEach(function (section, sectionIndex) {

               section.controls.forEach(function (control, index) {

                   control.getAttribute().setVisible("true/false");

               });

    Please refer below url for reference:

    community.dynamics.com/.../retrieve-all-of-the-field-names-in-a-tab

  • Suggested answer
    TNS Profile Picture
    TNS 1,195 on at
    RE: Hiding fields across tabs in the same form.

    Hi Kashyap,

    If you have too many conditions then you can use javascript, to hide the fields.

  • Suggested answer
    MMK Profile Picture
    MMK 745 on at
    RE: Hiding fields across tabs in the same form.

    You can use javscript to hide fields

    by tab, by section or by individual field itself

    use true to show false to hide tab directly

     var tab = Xrm.Page.ui.tabs.get("tabname");

      tab.setVisible(false); // show/hide

    //for show hide fields in a tab

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

                       

                   section.controls.forEach(function (control, controlIndex) {

                           try {

                               var attribute = control.getAttribute();

                               var attname = attribute.getName();

                             Xrm.Page.getAttribute(attname).setVisible(false);

                           } catch (e) {

                           }

                       });

                   });

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans