0
在CRM 2013中,我寫了一個JavaScript來刪除某些包含特定電子郵件地址的電子郵件參與者(在我的代碼中爲[email protected])。CRM Javascript:獲取參與者列表的電子郵件地址
我被告知最好的辦法是刪除整個電子郵件參與者並重新構建它,因爲沒有從電子郵件中刪除特定參與者的好方法(請糾正我,如果有更好的方法辦法)。
所以首先我得到的所有黨在郵件中的「收件人」字段。然後,我把'滿意的'參與者推到一個新的陣列中。包含[email protected]電子郵件的參與者將不會被推送到這個新陣列中,即從列表中刪除。
但是我有問題,試圖讓從「toParty」列表中的電子郵件地址值。
這似乎並不奏效,而是返回undefined。在這裏,我將通過電子郵件的模式名稱「EMailAddress1」進行分析。嘗試'emailaddress1'也不起作用。
toParty[indxAttendees].EMailAddress1 --> doesn't work
任何想法,非常感謝。
var toParty = Xrm.Page.getAttribute("to").getValue();
for (var indxAttendees = 0; indxAttendees < toParty.length; indxAttendees++) {
var partyListData = new Array();
if (toParty[indxAttendees].EMailAddress1 != "[email protected]")
{
//alert("Email address " + indxAttendees + " :" + toParty[indxAttendees].EMailAddress1); --> this will be undefined value
partyListData[indxAttendees] = new Object();
//get ID
partyListData[indxAttendees].id = toParty[indxAttendees].id;
alert("ID " + indxAttendees + " :" + toParty[indxAttendees].id);
//get Name
partyListData[indxAttendees].name = toParty[indxAttendees].name;
alert("Name " + indxAttendees + " :" + toParty[indxAttendees].name);
partyListData[indxAttendees].entityType = toParty[indxAttendees].entityType;
alert("Entity Type " + indxAttendees + " :" + toParty[indxAttendees].entityType);
}