A typical customer request is for email created from a Case to default to send to the Responsible Contact instead of its default behavior which is to send it to the Customer.
Since the Responsible Contact isn't even on the Case form by default and a customer could be a contact, MS chose this default behavior. However most of my installations to date have an Account as the Customer and one of many Contacts related to that Account as a Responsible Contact.
This is actually something very easy to change.
Please Note: This is an unsupported modification, and any patch could overwrite this.
There is a JavaScript file, cases.js, in the following folder.
C:\Program Files\Microsoft Dynamics CRM Server\CRMWeb\_static\CS\cases
It contains a function called locAddActTo that fills the To: activity party variables that are sent in the QueryString to the activity like the URL below.
http://crmserver1:5555/MicrosoftCRM/activities/email/edit.aspx?
pId={E0F2E676-7FE2-DD11-9AE8-0003FF517B20}
&pType=112
&pName=CaseTitleGoesHere
&partyid={0EDF3D7E-E3E0-DD11-A5F9-0003FF517B20}
&partytype=1
&partyname=AccountNameGoesHere
&partyaddressused=&contactInfo=
What we care about are the partyid, partytype and partyname arguments.
function locAddActTo(iActivityType, sContentId) { var sParentId = null; var sParentType = null; var sPartyId = null; var sPartyType = null; var sPartyName = null; var sPartyLocation = null; sParentId = crmFormSubmit.crmFormSubmitId.value; sParentType = crmFormSubmit.crmFormSubmitObjectType.value; if (iActivityType != Task) { var customerId = crmForm.all.customerid.DataValue; if (!IsNull(customerId)) { if (!IsNull(customerId[0])) { sPartyId = customerId[0].id; sPartyType = customerId[0].type; } } sPartyName = crmForm.customerid.parentElement.previousSibling.innerText; sPartyLocation = ""; }
As you can see this information is being pulled from the case form customer field crmForm.all.customerid.DataValue
So all we have to do is change this to crmForm.all.responsiblecontactid.DataValue
and change the sPartyName assignment.
sPartyName = crmForm.customerid.parentElement.previousSibling.innerText;
to
sPartyName = customerId[0].name;
You can just replace the above function with the one below if you would like.
function locAddActTo(iActivityType, sContentId) { var sParentId = null; var sParentType = null; var sPartyId = null; var sPartyType = null; var sPartyName = null; var sPartyLocation = null; sParentId = crmFormSubmit.crmFormSubmitId.value; sParentType = crmFormSubmit.crmFormSubmitObjectType.value; if (iActivityType != Task) { var customerId = crmForm.all.responsiblecontactid.DataValue; if (!IsNull(customerId)) { if (!IsNull(customerId[0])) { sPartyId = customerId[0].id; sPartyType = customerId[0].type; sPartyName = customerId[0].name; } } sPartyLocation = ""; }
After you have saved the change, run iisreset to flush the cache.
That's it.