Skip to main content

Notifications

Announcements

No record found.

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

How to hide and show custom button based on view (UCI)

(0) ShareShare
ReportReport
Posted on by 95

function HideButtonBasedOnViewSelected (selectedCtrl) {
var query = selectedCtrl.get_viewTitle();
if (query == 'Your View Name') {
return false;
}
else
return true;
}

This code is working good for classic UI but not working on UCI. please  suggest me other option or code for this scenario. 

  • Suggested answer
    Filipe Lopes Profile Picture
    Filipe Lopes on at
    RE: How to hide and show custom button based on view (UCI)

    Hello Altaf Haider Taqvi. 

    Hope you are doing well. 

    At this time selectedctrl.get_viewTitle() is not working in UCI. There is also nothing that refers that it will be added in the future for now. 

    I would recommend to always do everything in supported ways. However, there are some unsupported ways to achieve this as mentioned by Mehdi EL Amri. 

    You can follow his link, personally haven't tested it but looking at it seems to achieve the desired behavior. 

     

  • meelamri Profile Picture
    meelamri 13,206 User Group Leader on at
    RE: How to hide and show custom button based on view (UCI)

    Hi Altaf,

    Did you solve your issue?

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,206 User Group Leader on at
    RE: How to hide and show custom button based on view (UCI)

    Hi,

    Please refer to my post:

    medium.com/.../hide-ribbon-button-based-on-view-name-uci-b33be6d0d57

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

Featured topics

Product updates

Dynamics 365 release plans