Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7938047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:41:46+00:00 2026-06-03T22:41:46+00:00

I hope there is someone who can help me out here. I have found

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:41:47+00:00Added an answer on June 3, 2026 at 10:41 pm

    First of all, change event to post-operation, because you don’t have the GUID of created entity yet, as a matter of fact you dont have the entity itself as well that’s why it’s called pre-operation.
    To add multiple entities try pass a GUIDs array like in code bellow:

        // Setup the CrmConnection and OrganizationService instances
        CrmConnectionInstance = new CrmConnection(ConfigurationConstants.CrmConnectionName);
    OrgServiceInstance = new OrganizationService(CrmConnectionInstance);
        // Create the marketing list 
        Guid NewMarketingListId = Guid.Empty; 
        Microsoft.Xrm.Sdk.Entity CurrentList = new Microsoft.Xrm.Sdk.Entity(MarketingListConstants.MarketingListEntityName); 
        CurrentList[MarketingListConstants.MarketingListTypeAttribute] = false; 
        CurrentList[MarketingListConstants.ListNameAttribute] = "NameOfList"; 
        // For contacts, a value of 2 should be used. 
        CurrentList[MarketingListConstants.CreatedFromCodeAttribute] = new OptionSetValue(2); 
        // Actually create the list 
        NewMarketingListId = OrgServiceInstance.Create(CurrentList); 
        // Use the AddListMembersListRequest to add the members to the list 
        List<Guid> MemberListIds = new List<Guid>(); 
        // Now you'll need to add the Guids for each member to the list  
        // I'm leaving that part out as adding values to a list is very basic. 
        AddListMembersListRequest AddMemberRequest = new AddListMembersListRequest(); 
        AddMemberRequest.ListId = NewMarketingListId; 
        AddMemberRequest.MemberIds = memberIds.ToArray(); 
        // Use AddListMembersListReponse to get information about the request execution 
        AddListMembersListResponse AddMemberResponse = OrgServiceInstance.Execute(AddMemberRequest) as AddListMembersListResponse;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hope there's someone who can help me suggest a suitable data model to
I hope there is someone who can help me with this regex content.match(/<div class=content>.+#-#/ig);
I hope there is someone who can help me: I would like a horizontal
I hope there is a php genius here somewhere who can help me with
I hope someone out there can shed some light on the topic of creating
I find myself in a pickle, I hope someone can help. I have a
I hope someone can help. I have a link like this: <a id='testOne' onclick=doTest('one');
I hope there are someone who have used PDFCreator before. I am using PDFcreator
I have question on usage java nio and hope someone who has a lot
i'm in a situation my mind is blocked en hope someone can help me.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.