Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum
Answered

Disable Change View Option

Posted on by 125

Hi,

Is it possible to disable change view option?

User clicks on add existing button(contact sub-grid on custom entity) and during lookup records i want to restrict user from changing the view.I have tried by making the view selector  Off in sub-grid properties but that's not working.

6661.pastedimage1580930447593v2.png

5287.2020_2D00_02_2D00_05_5F00_1321_5F00_LI.jpg

1803.pastedimage1580930694452v3.png

  • Verified answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Disable Change View Option

    Hi partner,

    The option of  "view selector" in subgrid could only control the view of the subgrid, not in lookup view.

    For example:

    Enable view selector.

    2543.pastedimage1580958605333v1.png

    Disable view selector.

    3010.pastedimage1580958718389v2.png

    If you want to hide the change view ribbon, you could use unsupported JS code to hide it by css.

    5633.pastedimage1580959487778v3.png

    Add the code on the form onload event.

    function subgridCustomization() {
        var cssRules = '';
          cssRules  = 'ul[aria-label="Lookup recently used results"] {display:none!important} ';
          cssRules  = 'button[aria-label="Change View"]  {display:none!important}';
          var styleElement = parent.document.createElement('style');
          styleElement.appendChild(document.createTextNode(cssRules));
          parent.document.getElementsByTagName('head')[0].appendChild(styleElement);
    }

    This method was provided by Alex in this thread.

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/373000/how-to-restrict-recent-and-change-view-for-subgrid/986681

    Hope it helps.

    Best Regards,

    Leo

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,552 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,552 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans