Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Retrieve Mutiple

(0) ShareShare
ReportReport
Posted on by 250

Hello Everyone.

How can I do a retrieve multiple in C#, i need a plugin for when i create a register it ill autofill one of the form fields.

Can anyone help me ?

*This post is locked for comments

  • TaniSantos Profile Picture
    250 on at
    RE: Retrieve Mutiple

    to set the value of an entity into in a field in another entity,  how coud i do it ?

  • Suggested answer
    Anas Rafik Profile Picture
    365 on at
    RE: Retrieve Mutiple

    use this

    string myFetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
    	              "<entity name='opportunityproduct'>" +
    "<attribute name='opportunityproductid' />" + "<filter type='and'>" + "<condition attribute='opportunityid' operator='eq' uitype='opportunity' value='"+id+"' />" + "</filter>" + "</entity>" + "</fetch>"; EntityCollection fetchxmlResult = service.RetrieveMultiple(new FetchExpression(myFetchXml));


  • TaniSantos Profile Picture
    250 on at
    RE: Retrieve Mutiple

    In this line " query.Criteria.AddCondition("statuscode", ConditionOperator.Equal, 1);" where is written statuscode i ll put a field that i want to use as parameter ?

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
  • Suggested answer
    T.I.A Profile Picture
    1,760 on at
    RE: Retrieve Mutiple

    You can use a FetchExpression:

    Service.RetrieveMultiple(new FetchExpression(your fetch xml query method goes here));

    Or you can use a QueryExpression:

    QueryExpression query = new QueryExpression("your entity");

                               query.ColumnSet.AddColumn("field to return");

                               query.Criteria.AddCondition("statuscode", ConditionOperator.Equal, 1);

                               EntityCollection example = Service.RetrieveMultiple(query);

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans