web
You’re offline. This is a read only version of the page.
close
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

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

I have the same question (0)
  • ScottDurow Profile Picture
    21 on at

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

  • Verified answer
    Josh P. Profile Picture
    on at

    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!

  • Verified answer
    ScottDurow Profile Picture
    21 on at

    Hi,

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans