Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to add button dynamically in ribbon in MS Dynamics CRM?

Posted on by Microsoft Employee

Hello,

I want to add button in the ribbon in Add New Record or Update Record Form. I can add using RibbonXML project. But I want to add dynamically on the base of selected modules.

For example, if I select Product and Case modules, the button should only display in Add/Update product and case.

This is possible as there are already some plugins are providing this kind of functionality.

Here is example: appsource.microsoft.com/.../mtccrm.cf7661c4-254c-4de4-a342-15b82f419620

I want to add buttons dynamically.

Using Ribbonworkbench, I need to open solution --> I need to select entity --> Drag new button from tool panel given on the left --> Publish. I need to do this for each entity. I want to make this dynamic.

It should work like this: I have list of entities with checkboxes. If user check the checkbox for Product and Case entity, buttons should display for Product and Case entity records. If I check one more entity 'Order', it should display button in Order form also.

I understand that I need to code to add this. But I don't know what/where I need to code.

Can somebody please guide me? 

*This post is locked for comments

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: How to add button dynamically in ribbon in MS Dynamics CRM?

    Hi Chatya,

     you can use application ribbon to add the button:

    www.itaintboring.com/.../application-ribbon-in-dynamics-or-how-can-we-add-a-button-to-all-entity-forms

     Although, you will still need to set up a customrule (using javascript) that will control if that button is enabled or not (if it's not enabled, it'll be automatically hidden)

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add button dynamically in ribbon in MS Dynamics CRM?

    Hi,

    from my experience, yes you need to add it for all the desired entities. Then what you can do, is to create a configuration entity where you will save all your needs. Then when a form is open you do a WEbApi call to check if the user should or not see the buttons.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add button dynamically in ribbon in MS Dynamics CRM?

    Hi Raghu Yogesh,

    To do this, first I need to add button for each entity of CRM. How can I add for each? Using drag and drop in Ribbonworkbench? Poor idea I think.

    After performing above step, yes I can make is show/hide by Display rule.

    Actully, I also thought that adding button dynamically is not possible but I have seen in one pluing of AppSource as I have mentioned link in question.

    Please suggest.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add button dynamically in ribbon in MS Dynamics CRM?

    Hi Guillaume Domont,

    I want to add buttons dynamically.

    Using Ribbonworkbench, I need to open solution --> I need to select entity --> Drag new button from tool panel given on the left --> Publish. I need to do this for each entity. I want to make this dynamic.

    It should work like this: I have list of entities with checkboxes. If user check the checkbox for Product and Case entity, buttons should display for Product and Case entity records. If I check one more entity 'Order', it should display button in Order form also.

    I understand that I need to code to add this. But I don't know what/where I need to code.

    Please guide.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add button dynamically in ribbon in MS Dynamics CRM?

    Hi,

      As per my understanding it can't be done dynamically. What you can do is put Enable Rule or Display rule to show or hide as per your need.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to add button dynamically in ribbon in MS Dynamics CRM?

    Hi,

    from my experience you can dot it easily with the RibbonWorkbench: www.develop1.net/.../ribbonworkbench.aspx

    You can implement a custom enable Rules (ootb or with Javascript). Just be careful that the ribbon permission are only downloaded one time (onLoad), i.e. if you think that checking this box will show you the button dynamically. You are wrong. You will need to reload the entire record. :)

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans