Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Subgrid add new button customisation using ribbon workbench.

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 50,177 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 50,177 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

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