1
votes

I use Microsoft Dynamics CRM 2013 and I have requirement to show hide command bar button based on a selected view. I found that I can use custom JavaScript 'Enable Rule' to dynamically show hide command bar buttons. But I did not found any supported client side SDK methods to get selected view information other than accessing DOM.

Is there any supported client side SDK methods to get the selected view information in Dynamics CRM 2013?

Thanks in advanced!

1

1 Answers

0
votes

To answer your question, there is no supported way to do this.

They changed the ribbon (now called command bar) between 2011 and 2013.

1) you cant change the command bar based on different views of the same entity (that has always been the case). The RibbonDiffXML describes how the command bar should appear, and is only dynamic based on a limited set of parameters (selected view not being one of them).

2) you have to go to the "associated sub-grid" if you want command bar options specific to the selected entity (shown in the sub-grid). Otherwise the command bar will always display commands for the parent form that you are looking at - not for the entity subgrid you selected (this is new to 2013).

this article describes it well: http://develop1.net/public/post/4-things-you-need-to-know-about-the-new-Command-Bar.aspx