locked
Making Enable custom Ribbon button on CRM Entity on HomePage of Entity RRS feed

  • Question

  • Hello,

    How to do the Custom Ribbon button enable the same way we have outof the box fearure of any entity in crm eg: when we have lead click on marketing module -> willl open a grid ---> this time edit button on will be disabled. but when you select any lead in grid the edit button will be enabled----> How to do the same feaure in crm for Custom button On form?

    Thanks in Advance ...


    Sanjay

    Tuesday, July 24, 2012 6:57 PM

Answers

  • Hi Sanjay,

    If you add the button to the lead entity it will only appear for the leads, if you add to the application ribbon, it will appear for all.

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Marked as answer by Sanjay KS Thursday, July 26, 2012 3:56 AM
    Wednesday, July 25, 2012 5:23 AM
    Answerer

All replies

  • Hi Sanjay,

    I think you are asking how to have a button only enabled when a record is selected in a grid? 

    A good way to experiment and learn how this is done is to use the Ribbon Workbench (http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx) .

    Using this tool you can see how the out of the box system buttons work:

    1. Create a solution and add the Lead entity to it

    2. Open the Ribbon Workbench and load the solution

    3. Select 'SubGrid' from the drop down on the top right

    4. Select the 'Edit' button and use the 'left-click' Customise Command

    5. In the Solution Panel, you'll see the Edit Selected Record command.

    6. Use 'Left-Click'->Edit Enable Rules and select the 'Mscrm.CheckBulkEditSupportForEntity' rule

    7. If you select the enable rule in the 'Solution Elements->Enable Rules' you'll see that it uses the 'SelectionCount' rule to only be enabled when there is a minimum of 1 record selected.

    I suggest you do some experimentation with creating rules and buttons that use the 'SelectionCount' rule. The Ribbon Workbench makes it really easy to try things out and learn. 

    You can find more information at http://ribbonworkbench.uservoice.com/knowledgebase/articles/71374-1-getting-started-with-the-ribbon-workbench

    hth,

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Tuesday, July 24, 2012 9:40 PM
    Answerer
  • Thanks Scott for a nice summary and tool .

    Do we have any rule just put in customization for Lead and thing will be done ?


    Sanjay

    Wednesday, July 25, 2012 5:17 AM
  • Hi Sanjay,

    If you add the button to the lead entity it will only appear for the leads, if you add to the application ribbon, it will appear for all.

    Scott


    Scott Durow
    Read my blog: www.develop1.net/public
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    • Marked as answer by Sanjay KS Thursday, July 26, 2012 3:56 AM
    Wednesday, July 25, 2012 5:23 AM
    Answerer
  • <EnableRule Id="Mscrm.SubGrid.opportunity.BackupOwner.Enable">
                  <SelectionCountRule AppliesTo="SelectedEntity" Default="false" Minimum="1" />
                </EnableRule>

    This worked for me ....


    Sanjay

    Thursday, July 26, 2012 4:01 AM