海蘭傢伙創建歇電子郵件,如何行與SOAP請求在CRM
我想了幾個小時格式,JavaScript的SOAP請求創建一個電子郵件。但它不會工作,以建立換行符
\n
- 不工作 <br />
- 不工作 
; - 不工作 \u000A \u000D
- 不工作
這裏是我的電子郵件正文
get_EmailBodyInformManager: function (projectNumber, topic, responsibleDepartment, potentialCustomer, KAMofCustomer, projectManager) {
if (KAMofCustomer == null) {
KAMofCustomer = "";
}
return "Dear Sir or Madam. 
" +
"A decision about the project leader for the following international project is necessary: 
" +
"Project Number: " + projectNumber + "
" +
"Topic: " + topic + " 
" +
"Responsible Department: " + responsibleDepartment + "
" +
"Potential Customer: " + potentialCustomer + "
" +
"KAM of Potential Customer: " + KAMofCustomer + "
" +
"WILO Project Manager: " + projectManager + "";
},
和SOAP請求實際代碼:
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'>" +
authenticationHeader +
"<soap:Body>" +
"<Create xmlns='http://schemas.microsoft.com/crm/2007/WebServices'>" +
"<entity xsi:type='email'>" +
"<ownerid>" + userId + "</ownerid>" +
"<regardingobjectid type='opportunity'>" + OpportunityId + "</regardingobjectid>" +
"<subject>" + subject + "</subject>" +
"<description>" + body + "</description>" +
"<from>" +
"<activityparty>" +
"<partyid type='systemuser'>" + userId + "</partyid>" +
"</activityparty>" +
"</from>" +
"</entity>" +
"</Create>" +
"</soap:Body>" +
"</soap:Envelope>";
您是否在SOAP請求部分代碼中嘗試過「+」
「+'? –
是的,我曾試過。奇怪的是,
會削減文本,即在
標籤後面。 – ICantSeeSharp
如果我直接將它寫入SOAP請求,則出現錯誤消息「電子郵件實體不包含具有」br「的元素 – ICantSeeSharp