Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to add a custom button to Sub-grid View?

Posted on by Microsoft Employee

Here's the subgrid view on Account form.

I need to

1. Add a custom button on to left of "+" button and add JavaScript to the click event.

2. Customize the behavior of the "+" button so that I can use "Xrm.Utility.Openentityform" to control the opened form.

Is it possible to do either of them?

Thank you!

*This post is locked for comments

  • JVE Profile Picture
    JVE 213 on at
    RE: How to add a custom button to Sub-grid View?

    Documentation for Subgrid ribbons to the help to support what others already said:

    You can change the default behavior by changing the actions associated with the command using <CommandDefinition> (RibbonDiffXml), but you cannot change the name of the command. For example, you could change the delete action so that it deactivates the record rather than deleting it.

    It is not possible to change the icons displayed for these commands. You can hide these commands by using <HideCustomAction> (RibbonDiffXml).

    And on Command bar or ribbon presentation:

    Subgrids have a limited number of controls. Only controls to allow adding records, deleting records, or opening a view of the grid are available. But these commands are still defined by ribbon data and can be customized.

  • Suggested answer
    ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: How to add a custom button to Sub-grid View?

    Hi,

    Although you cannot add new buttons to the subgrid command bar - you can customise the behaviour of the buttons by customising the command or customising the button and wiring it up to a custom command.

    Hope this helps,

    Scott

  • Verified answer
    Aileen Gusni Profile Picture
    Aileen Gusni 44,522 on at
    RE: How to add a custom button to Sub-grid View?

    Hi,

    I am sure that we cannot add custom button on the left of + for subgrid, because we tried it before.

    But, for the second thing:

    2. Customize the behavior of the "+" button so that I can use "Xrm.Utility.Openentityform" to control the opened form.

    I am not sure that this is impossible to do.

    Because if we take a look in this link:

    http://garethtuckercrm.com/2013/11/19/fixing-the-sub-grid-user-experience-in-crm-2013/

    Gareth shows us how to 'modify' the behavior of + button by hiding the 'Add Existing Button',

    maybe you can try using RibbonWorkbench created by Scott to customize the New or Add New button:

    I also curious, I think it is possible to modify the behavior like what Gareth found for Add Existing one.

    Hope it helps!

  • Verified answer
    NatrajY Profile Picture
    NatrajY 3,040 on at
    RE: How to add a custom button to Sub-grid View?

    This is not possible OOB. The only way this could be done, is using Scott Durow's SparkleXrm project. But this involves custom code development. If you are happy to head this route, have a look at the samples in www.sparklexrm.com

  • Verified answer
    Deeps Profile Picture
    Deeps 1,875 on at
    RE: How to add a custom button to Sub-grid View?

    No

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans