In this webinar, our experts showcase a variety of demo use cases of how different components of the...
At PowerObjects we are always trying to make the Microsoft Dynamics CRM user experience the best it can be. We recently encountered an issue with the Outlook Reading Pane displaying all the tabs on the form even though we had written java script to show and hide these tabs on the form. So without further ado, let's explore how to hide tabs in reading pane for Dynamics CRM Outlook client.
The reason behind this is that the java script can't be fired on the Outlook reading pane. As you can see in the screenshot below, all of the tabs are displayed in the Outlook Reading Pane.
To resolve the issue, the first thing we need to do is modify the tab properties that are displayed on the form. You can do this by going into the Customizations and modify the form for the Opportunities. Once you have the properties of the tab open, uncheck the option to display the tab by default. In our example, I have unchecked this option for all tabs except for the General and the Activities and Notes.
The next step is to make sure your java script will display the correct tabs when the appropriate value is selected from the option set. Below is an example of that code.
/* setTabsVisibility() */ setTabsVisibility = function() { switch (Xrm.Page.getAttribute("po_opportunitytype").getValue()) { case 936710000: displayTabs("New Product"); break; case 936710001: displayTabs("Existing Product"); break; case 936710002: displayTabs("Both"); break; default: displayTabs(""); } } //This method will display only certain tabs based on the Opportunity Type selected function displayTabs(tabName) { if (tabName == "New Product") { Xrm.Page.ui.tabs.get("New Product").setVisible(true); Xrm.Page.ui.tabs.get("Product Line Item Details").setVisible(false); Xrm.Page.ui.tabs.get("Opportunity Quotes").setVisible(true); Xrm.Page.ui.tabs.get("notes and activities").setVisible(true); } if (tabName == "Existing Products") { Xrm.Page.ui.tabs.get("New Product").setVisible(false); Xrm.Page.ui.tabs.get("Product Line Item Details").setVisible(true); Xrm.Page.ui.tabs.get("Opportunity Quotes").setVisible(false); Xrm.Page.ui.tabs.get("notes and activities").setVisible(true); } if (tabName == "Both") { Xrm.Page.ui.tabs.get("New Product").setVisible(true); Xrm.Page.ui.tabs.get("Product Line Item Details").setVisible(true); Xrm.Page.ui.tabs.get("Opportunity Quotes").setVisible(false); Xrm.Page.ui.tabs.get("notes and activities").setVisible(true); } if (tabName == "") { Xrm.Page.ui.tabs.get("New Product").setVisible(false); Xrm.Page.ui.tabs.get("Product Line Item Details").setVisible(false); Xrm.Page.ui.tabs.get("Opportunity Quotes").setVisible(false); Xrm.Page.ui.tabs.get("notes and activities").setVisible(true); } }
Now when you open the Opportunities entity from the Microsoft Dynamics Outlook client we are only displaying the General Information and the Activites and Notes tabs in the Outlook Read Pane.
Hope this helps you make the Microsoft Dynamics CRM user experience the best it can be.
Happy CRM'ing!