Display email body in crm case description field RRS feed

  • Question

  • i need create case automatically when the email is received to CRM. I have done the case creation steps. now my problem is I need add the email body to case description . I have fetch the email body from email entity, but it in the html format. I have tried using the html tags removal methods "=((new System.Text.RegularExpressions.Regex("<[^>]*>")).Replace(Fields!Description.Value, ""))"  but it remove all the tags. so my mail formatting was totally destroyed even the separate lines also concatenate as one line. if there is any way show the mail body in case without affecting the mail format

    Ravin Singh D

    Monday, May 27, 2013 4:59 AM


All replies

    • Proposed as answer by myCRMGuy Monday, May 27, 2013 6:05 AM
    • Marked as answer by Ravin Singh Tuesday, May 28, 2013 4:06 AM
    Monday, May 27, 2013 5:59 AM
  • HI,

    In this case

    1. Create one iframe in the case entity

    2. Add the email body content dynamically in to the iframe using jscript.

    var html = "<html><head><title>Titolo</title></head><body><p>body</p></body></html>" //contents you are getting for email body
    jQuery('#popolaIframe').click(function() {
      var doc = parent.$("#indexIframe")[0].documentElement;


    var ifrm = document.getElementById('myFrame');
    ifrm = (ifrm.contentWindow) ? ifrm.contentWindow : (ifrm.contentDocument.document) ? ifrm.contentDocument.document : ifrm.contentDocument;
    ifrm.document.write('Hello World!');

    Monday, May 27, 2013 6:04 AM
  • Thanks for your reply!

    I am new to crm please tell me where I put this code. either field load or case page load

    Ravin Singh D

    Monday, May 27, 2013 7:11 AM
  • Hi,

    On page load of Case entity where you are fetching the email body from email entity.

    the code i have provided will put your email html to iframe which you are fetching form email entity. 

    Monday, May 27, 2013 8:27 AM
  • Hi

    I have done the email body fetching steps. it's works nice. now I have another problem, that is when my body of the email greater then 2000 character the body content does not add to the case description field. if there is any limitation for content size? if yes means how can I increase the limitation


    Ravin Singh D

    Tuesday, May 28, 2013 4:09 AM
  • Change the size of description field from 2000 to 4000 or size as per your need.
    • Proposed as answer by myCRMGuy Friday, May 31, 2013 8:36 AM
    Friday, May 31, 2013 8:36 AM