web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Hiding navigation item on Tablet using Javascript (Dynamics 365)

(0) ShareShare
ReportReport
Posted on by

I've been using this function to hide a relationship navigation item on a form in a certain condition using Javascript:

ToggleNavigationItem = function (navName, isVisible) {
var navs = Xrm.Page.ui.navigation.items.get();
for (var i in navs) {
var nav = navs[i];
if (nav.getLabel() === navName) {
nav.setVisible(isVisible);
}
}
};

It works well on the web but it raises an error on the mobile application as it doesn't recognize "items", does anyone know what to replace it with for the mobile to do the same functionality?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Omnia,

    I don't think you have the respective code for mobile/ tablet client. You could avoid the error by adding a check in your current script to identify if this is web client or Mobile/table as per the below-

    msdn.microsoft.com/.../dn481572.aspx

    Hope this helps

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Below is the list of methos which aren't supported in Mobile client-

    msdn.microsoft.com/.../dn481572.aspx

  • Community Member Profile Picture
    on at

    Thanks for your reply Ravi, I came across this page before but unfortunately it only mentions what is not supported without mentioning what to replace it with

    I added the code to prevent raising an error in case of using the Mobile/Tablet but I still need to hide the navigation button but I couldn't find the supported code for this yet

  • ag1 Profile Picture
    on at

    Did you ever find a solution to this?  I'm having the same problem.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans