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;

  1. Create a hosted control to be the email tab. (If you haven’t got one already.)
  2. Create an action to load a new email tab, populated with details from the account.
  3. Add a toolbar navigation button to the account.
  4. 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;

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;

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;

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;

Email

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.

email2

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.

19 responses to “USD – Send Emails”

  1. Wonderful Blog……..Keenly waiting for your every post on USD.

    Like

  2. Keenly waiting for your post………wonderful blog

    Like

    1. Hi sir,

      I have just try to implement this particular Blog on E-mail activity inside the MS USD but couldn’t & when I checked the Error appears highlighted in Red, Inside the Debugger hosted control in the USD, when I hover around over this error, I was getting Error message “Not all the parameters in the action call New_CRM page are available”. So, Please check the coding part in this blog & Revert As soon as possible.

      Thanks !!!!!!!!!!!!!!

      Like

      1. I will check the post is correct tomorrow, I actually had a similar problem earlier when creating an action call to create an opportunity. Depending on your situation it might be best to use syntax something like [[$context.name]+] sometimes replacing say contact. with $context. can help. Also the + is useful, as this handles nulls. This sort of stuff can be tricky to get working as debug messages aren’t always very detailed. Can you send me a copy of your debug output, that might help me see what is happening.

        Like

      2. Another thought …. Do you have email hosted control opening in a separate tab? I have a window navigation rule to open email tab. Could it be navigation rules????

        Like

  3. Hi sir, Firstly Thanks for your reply. I have a “Mail Button” on the Main Toolbar inside the Microsoft USD on clicking of this button; there is E-mail Tab opens in the Navigation Toolbar which is currently displaying nothing, & the error inside debugger is already mention by me. Share Can please share your e-mail id with me, as I am not able to upload the error output here.

    Like

    1. Yes, you can email me at neilparkhurst@hotmail.co.uk

      I suspect this is a windows navigation rule issue. I will update the post to explain soon. Basically the windows navigation rule needs to trigger the load of the required CRM Page. The action to create the email needs that to be ready to receive the email. So I think this is a sequencing issue. It you send me a copy of some debug output I should be able to confirm. (I hope!)

      Like

    2. I am sure now you problem is window navigation rules, I have updated the post to explain. (As I have seen similar issue on something else!)

      Like

  4. I’m curious as to how you got the CreateEntity to work. I ran similar code through the Debugger and it doesn’t like the fact that ‘partyid’ isn’t on the email entity.

    Like

    1. I based the code on a similar action that already existed in the Microsoft sample solution. I have used it several times on on-premise and online versions of CRM.

      I have found that the whenever I’ve used the “New_CRM_PAGE” action the windows navigation rules play a big part. Even though the debugger shows all the values set as you expect. The windows navigation rules needs to have already triggered the load of a suitable tab. I have added information in my post about this and shown the results I got in the debugger when this works. Hopefully that will help.

      Like

  5. Hi sir, Thanks a lot. Yes, Now it’s working…It means earlier window navigation rule was the problem area.

    Like

  6. Just one question, If we have to modify the same post, to mail any of the contact from MS CRM, then below code is correct one or not ?

    LogicalName=email
    regardingobjectid=[[contact.Id]]
    regardingobjectidname=[[contact.fullname]]
    regardingobjecttypecode=contact
    partyid=[[account.Id]+]
    partyname=[[contact.fullname]+]
    partytype=[[contact.etc]]

    Like

  7. * partyid=[[contact.Id]+]

    Like

    1. Correct, your code looks right to me.

      Like

  8. Neil, have you had any issues around inserting a template to an email in usd and then attaching files? when i go to insert attachments after i have inserted the template it crashes usd.

    Like

    1. Hi Una,

      I hadn’t seen this problem but since getting your message I have tried it. USD does crash when I add an attachment. (Even without a template.)

      I think I can see the problem.

      When you click the “+” on the attachments sub grid the form changes. Meaning the email is no longer on the screen. Having added the attachment when you click close, to return to the email USD crashes.

      I suspect the solution would be to make the attachments show in a separate tab. I guess this would need a window navigation rule but I haven’t worked out exactly what that needs to look like.

      I did however see that the email attachment does get added correctly. Which is one positive!

      I suggest you try to get a separate tab to load when adding attachments to emails.

      If that doesn’t work maybe consider raising a support ticket with Microsoft. because USD is crashing this does sound like a product bug.

      Please let me know how you get on as this problem interests me!

      Thanks (and sorry I haven’t got an instant fix)

      Neil.,

      Like

Leave a comment

Trending

Website Powered by WordPress.com.