hello everyone,
i try to get some details from dynamics crm (Phonecall entity) and to make this information in a body from an email. the problem is when have a multi line in the "description Field", all the text will in one line wrote in the email body(see pictures). can anyone help me Thanks.
function TriggerOutlook() { //get the form value var form=Xrm.Page.ui.getFormType(); //if the form is saved if(form==2) { // get the end date var scheduledend = Xrm.Page.getAttribute("actualend").getValue(); var date =scheduledend.toString(); var date_split = date.split(' '); switch(date_split[1]) { case "Jan": var month="01"; break; case "Feb": var month="02"; break; case "Mar": var month="03"; break; case "Apr": var month="04"; break; case "May": var month="05"; break; case "Jun": var month="06"; break; case "Jul": var month="07"; break; case "Aug": var month="08"; break; case "Sep": var month="09"; break; case "Okt": var month="10"; break; case "Nov": var month="11"; break; case "Dec": var month="12"; break; } var end_Time=month "/" date_split[2] "/" date_split[3] ; var sub=Xrm.Page.getAttribute("subject").getValue() ; //get the description var description = Xrm.Page.getAttribute("description").getValue(); //get the required Value var required = Xrm.Page.data.entity.attributes.get("to").getValue(); //test of the empty fields if (end_Time == null) { end_Time=""; } if(description == null) { description=""; } if( required==null || required=="") { required=""; } else { var required_name=required[0].name; var required_id=required[0].id.toLowerCase(); } // trigger the Outlook var subject=required_name ", " sub ; var body = "End Time:" end_Time escape('\n') "Account:" required_name escape('\n') "Contact:" escape('\n') "Description:" description; window.location.href = "mailto:?body=" body "&subject=" subject; } }