Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to remove change view

Posted on by 1,195

Hi,

I have a subgrid , and when I click on add existing record lookup records option come. When I click on it at below the change view option come which I don't want. So I want to remove the option or the user can't change the view. I have  tried view selector properties of subgrid but no help. So if any suggestion will be very helpful.

pastedimage1595846363357v1.png

  • TNS Profile Picture
    TNS 1,195 on at
    RE: How to remove change view

    Hi Andrew and Bipin,

    Thanks for your suggestion but it helped for removing recent records options. What I have tried is using below code which I found while browsing, behind add existing button, its a unsupported way but it helped for removing "Change View" and "Recent Record" button:

    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);

    }

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: How to remove change view

    Hi,

    I don't think it is possible to hide change view option from subgrid view. However you can disable this option when you select view selector option to Off on subgrid properties. Also, when you only select one view in subgrid propertied this option will be disabled.

    If found helpful, Please mark my answer verified.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to remove change view

    Hello,

    I'm afraid there is no no-code way but I believe you can do it using Ribbon Customizations and some javascript. Here are posts can help you:

    blog.magnetismsolutions.com/.../filter-n-n-add-existing-lookup-dynamics-365-v9-supported-code

    docs.microsoft.com/.../lookupobjects

    First post explains on how you can override JS called on click of "Add Existing" button. Second post - is specification of lookupObjects and to remove possibility to choose the view - pass the list of ids of specific views to be shown.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans