locked
Dynamics CRM 2011, Call multiple entities in one go RRS feed

  • Question

  • I am working on application which all the master data from CRM entities seperately using Microsoft.Xrm.Sdk (CRM web service).

    Issue is, currently we are calling all entities seperately from .NET, which makes WCF call earch time.

    I am trying to implement solution, in which I will call seperate entities in one go, so that in 1 WCF call I have all the master data.

    So Sql Equivalent will be Select x from Entity1; Select y from Entity2

    I am using QueryExpression & then calling RetrieveMultiple(query) method.

    I tried to look into sueestion mentioned, "Please refer the Execute Multiple Request for more about execute multiple request." It has sample for Create/Update/ Delete but not for select from multiple entities. Can you provide some refrence where I can find multiple selects.

    Any help will be appreatiated.

    Thanks, Div


    • Edited by no1shah Friday, February 14, 2014 5:02 AM Not getting response
    Thursday, February 6, 2014 10:02 AM

All replies

  • Hi,

    You can use ExecuteMultipleRequest message for dealing with this scenario. Consolidate all your master data retrieve requests and add them in the request collection of executemultipe request.

    This way you have to make only a single service request and you will get all the data needed in one go.

    Please refer the Execute Multiple Request for more about execute multiple request.

    Thanks

    Kuldeep

    • Proposed as answer by Kuldeep Trivedi Thursday, February 6, 2014 10:18 AM
    Thursday, February 6, 2014 10:18 AM
  • Alternatively, if the records are related via relationships, you can use LinkEntities in your query (QueryExpression or FetchExpression) and get the results from the Entity.RelatedEntities collection

    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

    Thursday, February 6, 2014 2:51 PM
    Moderator
  • Thanks for your response, I gone through refrence you given. I guess it has sample for Create/Update/ Delete but not for select from multiple entities. Can you provide some refrence where I can find multiple selects.
    Monday, February 10, 2014 7:18 AM