Answered by:
crm 4.0 e-mail (reply; reply all)

Question
-
Is there a way to know, some property or something that can tell me if there is way to know, some property or something else that can tell me if it was replied to an e-mail from crm.
I've received a mail and have replied to it. Is the RE: mail somehow associated with the original?
Wednesday, June 8, 2011 12:31 PM
Answers
-
Hello,
I had the same task. I did the investigation and I found that this is not tracked. So I used following approach:
1. I added custom varchar attribute to email and called it new_parentemailid.
2. Added following script to onload of email:
Purpose of following script is to update added custom field with identifier of parent email for creation of relation. After it I was able to build relations with these emails.if (crmForm.FormType == 2 && window.location.search != null && window.location.search.indexOf('_InReplyToId') != -1) { var query = window.location.search; if (query == null || query == "") return; query = query.substring(1, query.length - 1); var queryparts = query.split("&"); var parentid = null; for(var i = 0; i < queryparts.length; i++) { var params = queryparts[i].split("="); if (params[0].toLowerCase() == "_inreplytoid") { parentid = params[1].replace("%7b","").replace("%7d",""); break; } } if (parentid == null) return; var xml = "<?xml version='1.0' encoding='utf-8'?>"+ "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'"+ " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"+ " xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"+ GenerateAuthenticationHeader()+ "<soap:Body>"+ "<Update xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+ "<entity xsi:type='email'>"+ "<new_parentemailid>"+parentid+"</new_parentemailid>"+ "<activityid>"+crmForm.ObjectId+"</activityid>"+ "</entity>"+ "</Update>"+ "</soap:Body>"+ "</soap:Envelope>"; var xHReq = new ActiveXObject("Msxml2.XMLHTTP"); xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false); xHReq.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Update"); xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); xHReq.setRequestHeader("Content-Length", xml.length); xHReq.send(xml); }
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)- Marked as answer by Donna EdwardsMVP Saturday, June 11, 2011 2:29 AM
Wednesday, June 8, 2011 12:45 PMModerator
All replies
-
Hello,
I had the same task. I did the investigation and I found that this is not tracked. So I used following approach:
1. I added custom varchar attribute to email and called it new_parentemailid.
2. Added following script to onload of email:
Purpose of following script is to update added custom field with identifier of parent email for creation of relation. After it I was able to build relations with these emails.if (crmForm.FormType == 2 && window.location.search != null && window.location.search.indexOf('_InReplyToId') != -1) { var query = window.location.search; if (query == null || query == "") return; query = query.substring(1, query.length - 1); var queryparts = query.split("&"); var parentid = null; for(var i = 0; i < queryparts.length; i++) { var params = queryparts[i].split("="); if (params[0].toLowerCase() == "_inreplytoid") { parentid = params[1].replace("%7b","").replace("%7d",""); break; } } if (parentid == null) return; var xml = "<?xml version='1.0' encoding='utf-8'?>"+ "<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'"+ " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'"+ " xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"+ GenerateAuthenticationHeader()+ "<soap:Body>"+ "<Update xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>"+ "<entity xsi:type='email'>"+ "<new_parentemailid>"+parentid+"</new_parentemailid>"+ "<activityid>"+crmForm.ObjectId+"</activityid>"+ "</entity>"+ "</Update>"+ "</soap:Body>"+ "</soap:Envelope>"; var xHReq = new ActiveXObject("Msxml2.XMLHTTP"); xHReq.Open("POST", "/mscrmservices/2007/CrmService.asmx", false); xHReq.setRequestHeader("SOAPAction","http://schemas.microsoft.com/crm/2007/WebServices/Update"); xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); xHReq.setRequestHeader("Content-Length", xml.length); xHReq.send(xml); }
Microsoft CRM Freelancer
My blog (english)
Мой блог (русскоязычный)- Marked as answer by Donna EdwardsMVP Saturday, June 11, 2011 2:29 AM
Wednesday, June 8, 2011 12:45 PMModerator -
I'll try that. Thanx for your suggestion Andriy.
Wednesday, June 8, 2011 12:49 PM