I hope there is someone who can help me out here. I have found an article which gives you the short piece of code to add Add Multiple Entities (Members) to a Marketing List. So far so good. I'm coming across this problem. I have a custom lookup field which gets another marketing list (has contacts, accounts or leads) inside the marketing member list. Now I need to migrate (add) those members into my new marketing list. The code I have:
1. AddListMembersListRequest request = new AddListMembersListRequest();
2. request.ListId = Origmarketing_List_Id.Id;
3. request.MemberIds = new Guid[1];
4. request.MemberIds[0] = guid;
5. AddListMembersListResponse resp = (AddListMembersListResponse)service.Execute(request);
Line 2 is the ID I get from the EntityReference(Look Up field getting another Marketing List), now the third and fourth line I'm setting is something I'm really confused about but still I'm sure I'm going right here because I'm setting it to the listmemberid. In this example I just had one cause I wanted to try out how it works. The guid in line 4 bdw gets the right value, it is declared at the top of my code(and I have output it on another field just to check it grabs the right value). Also can someone please show how you would do this when you want to add multiple entities? Thanks. I'm registering my plugin on pre-operation(Create). And the plugin itself doesn't fire any errors, but it just doesn't seem to add any members on my new list. I would really much appreciate if somone could help me out here. Thank You Really Much in Advance.