Thursday, 27 July 2017

{Know-how} Add a ribbon button using Ribbon WorkBench


Though its an age old topic, would like to write down step-by-step approach to add an ribbon button for reference.

CRM instance with ribbon workbench solution  or Xrmtoolbox

Add a ribbon button on account and on click of the ribbon button show the URL of the record.

  1. Open ribbon workbench
  2. Select the solution that contains account entity. 
  3. Add a new js command. Using command we can define JavaScript function or an URL action called on click of ribbon button.
  4. Lets add a Javascript action and call our Alert function which is available in existing Js webresource
  5. Now add the ribbon button and fill in the necessary details. Also link the command to the button and publish the changes
  6. Once done navigate to account and click the button to view the alert
Code snippet to alert URL:
 function alertURL() {  
 var url= "{0}/main.aspx?etn={1}&id={2}&pagetype=entityrecord"  
  Xrm.Utility.alertDialog( url.replace("{0}",Xrm.Page.context.getClientUrl()).replace("{1}","{2}", encodeURIComponent(;  

HTH! Please leave your feedback on comments section!

No comments:

Post a Comment

Contact Form


Email *

Message *