locked
Hide/Show contextual tab on click event of subgrid

    Question

  • Hi all,

    Do you have any idea on how to hide/show the contextual tab shown after clicking the subgrid of a form in CRM 2011? The scenario is: I have 3 subgrid in 1 form, upon clicking the first subgrid the contextual tab that contains the ribbon must be hide, however upon clicking the second subgrid it must be shown to the user. Please help me find a solution.

    Thanks,

    Girleene

    Wednesday, January 18, 2012 12:59 AM

Answers

  • Hi,

    As I understand it ,  the second sub grid is of the same entity ? if yes then you will not be able to do it .

    No, it cannot be done in any other supported way because it appears on ribbon and you have to do ribbon customizations to change its behaviour.

    hope it helps.


    cheers, S.Khan MCTS
    Wednesday, January 18, 2012 3:24 AM

All replies

  • Hi,

     

    this can be achieved by doing ribbon customizations on the entity whose records are showing up in the sub grid.

    for example, if you are showing up contact records in a sub grid on Organisation form then you will have to make a change on contact entity's ribbon.

     

    add this custom action within the ribbon (customizations.xml) 

     

     

     

     <HideCustomAction Location="Mscrm.SubGrid.contact.MainTab.Management" HideActionId="Mscrm.SubGrid.contact.MainTab.Management.HideAction" />
    
              <HideCustomAction Location="Mscrm.SubGrid.contact.MainTab.Workflow" HideActionId="Mscrm.SubGrid.contact.MainTab.Workflow.HideAction" />
    
              <HideCustomAction Location="Mscrm.SubGrid.contact.MainTab.Filters" HideActionId="Mscrm.SubGrid.contact.MainTab.Filters.HideAction" />
    
    

     

     

    as you can see these lines of code will hide the Management,Workflow and Filters  sections from the sub grid ribbon, you will have to do it for other sections as well.

    Please bear in mind that if you make this change, then where ever a sub grid will appear it will be the same everywhere else because the source is contact entity. so if it meets your requirements then it should be fine.

    hope it helps,


    cheers, S.Khan MCTS
    • Proposed as answer by Sanaullah Khan Wednesday, January 18, 2012 1:19 AM
    • Edited by Sanaullah Khan Wednesday, January 18, 2012 1:51 AM
    • Marked as answer by girleene Wednesday, January 18, 2012 2:50 AM
    • Unmarked as answer by girleene Wednesday, January 18, 2012 2:58 AM
    Wednesday, January 18, 2012 1:19 AM
  • It works fine. I put it inside the <CustomActions> . Thank you so much S.Khan. :D However, the only problem is the fact that it would apply to all subgrid inside 1 form. Is there any other way to handle this? I need to show the tab when the second subgrid was clicked. Thank you.

    Regards,

    Girleene


    • Edited by girleene Wednesday, January 18, 2012 2:58 AM
    Wednesday, January 18, 2012 2:49 AM
  • Hi,

    As I understand it ,  the second sub grid is of the same entity ? if yes then you will not be able to do it .

    No, it cannot be done in any other supported way because it appears on ribbon and you have to do ribbon customizations to change its behaviour.

    hope it helps.


    cheers, S.Khan MCTS
    Wednesday, January 18, 2012 3:24 AM