Here I describe how you can create a toolbar button in an accounts navigation bar to send an email. You can adapt this idea for other entities or even combinations! (As you might want to send an email to a contact but regarding a case.)
The steps involved are;
- Create a hosted control to be the email tab. (If you haven’t got one already.)
- Create an action to load a new email tab, populated with details from the account.
- Add a toolbar navigation button to the account.
- Ensure you have a suitable window navigation rule.
I’m going to assume you understand toolbars, if not see my earlier post on these.
You can of course take a similar approach but call the action from an agent script.
Step One – Email hosted control.
Simply navigate to hosted controls in the Unified Service Desk settings and add a new control like the one below.
Things to note include;
- Display name: I decided to set the to the subject of the email, it will actually be “Email” until a subject has been set
- USD Component Type is “CRM Page”
- Display group is “MainPanel”
Step Two – Create an action to load a new email tab, populated with details from the account.
Now navigate to the actions area in the unified service desk settings and add a new action. Mine is shown below. Things to note include;
- Hosted control is Email. (the one you just created)
- The action is New_CRM_Page, this is going to load a new page and populate it with values. But it isn’t going to save / send the email just yet.
- The data portion is shown below, here you populate the email with various details from the account. (You could adapt for other entities!)
LogicalName=email regardingobjectid=[[account.Id]] regardingobjectidname=[[account.name]] regardingobjecttypecode=account partyid=[[account.Id]+] partyname=[[account.name]+] partytype=[[account.etc]]
Step Three – Add a toolbar navigation button to the account.
You’ll need a method to trigger the action, I chose to create a toolbar button. I simply added a new toolbar button to an existing toolbar I had created for account navigation. You may also consider adding an answer to an agent script to send email.
My toolbar button looked like the one below. Things to note include;
- Image, msdyusd_Email16. I opted to just have an icon in the toolbar, no button text was needed.
- Order 7, as this is the 7th button in my toolbar.
- After saving the toolbar button I have added the action just created.
Step Four – Ensure you have a suitable window navigation rule
Before “messing” with your windows navigation rules test what you have already written, it may work. If not a probable reason is you haven’t got a suitable window navigation rule. I think the reason is the navigation rule needs to load the correct hosted control ready to receive the new page you’ll trigger with the new page action. Things to note include;
- From is “Email”.
- Entity is “Email”.
- The route type is “Popup”. (If popup doesn’t work try again with “in place”, I know not scientific but in my experience the setting of route type has been a bit hit and miss!)
- Show tab and target tab are “Email”.
- I have opted to set hide navigation bar to “yes”, just because I like to remove as much navigation as possible. But “no” is also a valid answer here.
Final tip, if you need to debug this you’ll be looking for your debug results to look like those below. Notice that you can see the windows routing rule fire before the New_CRM_Page action. And that all of the parameters have sensible values.
I admit this was a little tricky to get right first time but once you’ve got this working on one entity it is easy to replicate.