Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications

|

How to Open an Email Activity with a Custom Button

Post Author: Joe D365 |

You may ask why would we ever need a custom button to open an email activity from a record while we can do it from the social pane! Well, good question, and here is the answer: Users want to do their work with fewer clicks.

Note: Please check out previous blog posts to learn how to use Scott Durow's Ribbon Workbench to create a custom button.

Let's say we want to open the new email activity and load a specific template when a custom button is clicked on an account record.

1. Add the following libraries to the Email form:

  • Sdk.Soap.min.js
  • Sdk.InstantiateTemplate.js

NB: It is highly recommended to combine both files in one to avoid JS files loading sequence issues.

2. Open the Email form in edit mode, click Form Properties and add two new parameters "parameter_1" and "parameter_2".

custom button

3. Use the following code on the click event of the custom button.

custom button

4. Add this code to the onLoad event of the Email record.

custom button

NB: You can choose which template to load based on a business case scenario/rule that you can define in the JavaScript code.

5. When the custom button is clicked on the Account record, an email activity is opened in a new popup window and the template is loaded.

custom button

As always, if you need assistance the Dynamics 365 experts at PowerObjects are here to help!

Happy D365'ing!

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

One comment on “How to Open an Email Activity with a Custom Button”

  1. what about a reply button for an email activity from the social pane? is that doable?

PowerObjects Recommends