POWEROBJECTS

718 Washington Ave. N. Suite #101
Minneapolis, MN 55401
View map and all Locations

Send us a message

In Microsoft Dynamics CRM 2011, you have the option to customize the ribbon and create rules for any buttons that you add. If you don’t want to use out-of-the-box rules, you can add your own custom rule using JavaScript.

customizing

After you create a custom ribbon button and add a rule, you can define the rule as a custom rule. Here’s how:

  1. First make sure that the entity with the ribbon button is in the solution that you want to work with.

    Custom Rules for Ribbon Buttons in CRM 2011

  2. Now create a JavaScript file to make the custom rule. The code will return true or false to answer the condition.

  3. Export the solution and mark the customization when you export it.


  4. Now you can extract the customization.xml file that exist inside the solution.

  5. Modify the code as follows to enable the rule in the CommandDefinition. Point to the Id of the rule. The rule itself is under RuleDefinitions.

    image_update_custom_rules

  6. Finally, copy the file and reimport it.

There you have it—a simple guide to using JavaScript to create custom rules for ribbon buttons in CRM 2011!

If you want more information on customizing the ribbon in Microsoft Dynamics CRM 2011, check out our blogs on how to hide a ribbon button or our general guide on ribbon customization.

Happy CRM’ing!

Avatar for JoeCRM

JoeCRM

Joe CRM is a CRM superhero who runs on pure Microsoft Dynamics CRM adrenaline. As the face of PowerObjects, Joe CRM’s mission is to reveal innovative ways to use Dynamics CRM and bring the application to more businesses and organizations around the world.