Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Subgrid add new button customisation using ribbon workbench.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Dear all,

I am facing a problem with customising a subgrid add new button .

I have a subgrid ,I want to attach a JavaScript function to the add new(+) button of the subgrid.

Reason: i have two similar subgrids with(+) on a form , say subgrid1 and subgrid2

When I click (+) button on subgrid 1 it opens the form, when it opens I want to hide say section1 and show section2

Now when I click (+) button on subgrid 2 it opens the form , when it opens I want to hide section2 and show section1.

For this i need to attach a JavaScript function to the (+) button of the subgrid. When i do the (+) button gets hidden.

Please help..

Thanks.

*This post is locked for comments

  • Verified answer
    ScottDurow Profile Picture
    ScottDurow 19 on at
    RE: Subgrid add new button customisation using ribbon workbench.

    Hi,

    Just to add to the steps above you should right click and select 'Customise Command' after step 2!

  • Verified answer
    Josh P. Profile Picture
    Josh P. on at
    RE: Subgrid add new button customisation using ribbon workbench.

    Hi Mythilias!  I can give general steps below that have worked for me and they do not hide the (+) button.

    1) Load your solution in XRMToolbox's Ribbon Workbench.

    2) Click on the +Add New {0} button.

    3) Click Customize Command (Thanks, Scott!)

    4) On the left side, under the Commands heading, select the single option available (Mscrm.OpenAssociated...)

    5) On the right side, choose + Add Action just below the custom Javascript that already exists.  Select Custom Javascript option.

    6) Select your Library and Function name and voila!

    7) You can test by having your function only contain an alert("Working!"); to be sure it's firing correctly!

  • ScottDurow Profile Picture
    ScottDurow 19 on at
    RE: Subgrid add new button customisation using ribbon workbench.

    Could you post the Ribbon Xml that you are using please (from the xml tab in the Ribbon Workbench)

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,468 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,289 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans