0
我試圖將成員添加到CRM 2011工作流程活動中的營銷列表。它執行下面的代碼後,它是說,fromListCreated成員計數爲0,它應該是1.我已驗證members[0]
和AddMemberRequest.MemberIds[0]
確實包含成員GUID。有誰知道我錯過了什麼?在CRM 2011工作流程活動中將成員添加到市場營銷列表
List fromList = new List();
List fromListCreated = new List();
fromList.CreatedFromCode = new OptionSetValue(2);
fromList.ListName = "My List";
Guid fromListGuid = service.Create(fromList);
var list = service.Retrieve("list", fromListGuid, new Microsoft.Xrm.Sdk.Query.ColumnSet(true));
fromListCreated = service.Retrieve(list.LogicalName, list.Id, new Microsoft.Xrm.Sdk.Query.ColumnSet(true)).ToEntity<List>();
Guid emailFrom = Guid.Empty;
if (EmailFrom != null)
{
emailFrom = EmailFrom.Get(executionContext).Id;
}
else
{
// Default to the inhouse attorney user
emailFrom= thisCase.lgl_inhouseattorneyid.Id;
}
Guid[] members = new Guid[1];
members[0] = emailFrom;
AddListMembersListRequest AddMemberRequest = new AddListMembersListRequest();
AddMemberRequest.ListId = fromListCreated.Id;
AddMemberRequest.MemberIds[0] = members[0];
AddListMembersListResponse AddMemberResponse = service.Execute(AddMemberRequest) as AddListMembersListResponse;
service.Update(fromListCreated);
看不到任何東西丟失。你收到什麼迴應? – Scorpion