Tip #33: Create a two-action ribbon button

Do your users have a CRM process that requires them to perform two unrelated actions in CRM? For example, a marketing department needs to run a mail merge and then have a workflow update the same selected records. Since these are separate actions, it can be cumbersome to the users, and can also have a fairly high potential for user error.

One great option is to create a CRM Command Bar/Ribbon button that launches both actions. In this post I’m going to show how to make a single button that launches mail merge and then runs an on demand workflow on the same selected records.

  1. Get the Ribbon Workbech from Develop1. Really. Get it now. Why don’t you have this already?
  2. Add a new button. You can re-use the standard Mail Merge icon by clicking on the standard mail merge button in Ribbon Workbench and copying the path for the two image sizes and pasting into your new ribbon definition.
  3. Right click on the standard Mail Merge button in Ribbon Workbench and select “Customize Command.” This will make a copy of the standard Mail Merge to selected records command that you can edit.
  4. Edit the command and follow the instructions in step 9 of this great post by MVP Scott Durrow to add the action to run the on demand workflow. You don’t need to do the Enable or Display rules–the standard Mail Merge command already includes the appropriate logic to display for only selected records.
  5. Publish and enjoy.

Now when users need to do their combined mail merge/workflow process, they can select the appropriate records, hit the button, do the mail merge, and the run workflow dialog will appear immediately when they are done.

This is just one example of how you could use this idea. You could combine virtually any unrelated function: resolve a case and create a new record, run a workflow and launch a dialog, launch two dialogs and a workflow. The possibilities are almost endless.

Share on FacebookTweet about this on TwitterShare on Google+

4 thoughts on “Tip #33: Create a two-action ribbon button

  1. Raffi says:

    Is there a way to make a button which directly starts a predefinied mail merge template? So the user can click the button and it opens Word.
    (SSRS would be plan B)

    • Joel Lindstrom says:

      no, mail merge happens in Microsoft office. No way to directly call specific merge template.

      • Swathi says:

        I did not understand why there is need to create new button as mentioned in step 2. We can directly customize the existing Mail merge button and add action to existing command

        • Joel Lindstrom says:

          Yes, you can modify the existing button, but there are several reasons not to. This is technically unsupported, as this is not documented anywhere in official documentation, but modifying OOTB buttons is more unsupported. If you don’t care about that, practical reasons to use a new button:
          1. It is less likely to get overwritten by other solutions, such as ISV solutions that include the standard ribbon button.
          2. It is less likely to break or get overwritten in an upgrade.
          3. I forget what I do and plans change. 5 years from now, we may have totally new people using the system. They take training and learn about the standard button, but wait, ours behaves differently. By going with a custom button, it is clear that our custom two feature button is different, so you can avoid embarrassing calls to support.

          So that is why I would take the time to create a new button rather than modifying the existing one.

Leave a Reply

Your email address will not be published. Required fields are marked *