locked
Unable to retrieve custom attributes using retrievemultiple in ms crm 2011 RRS feed

  • Question

  • Hi,

    I am trying to retrieve all the attributes(including custom attributes) of account entity using retrievemultiple  from an external application.

    I am using the following code:

     

     Microsoft.Xrm.Sdk.Query.QueryExpression qe = new Microsoft.Xrm.Sdk.Query.QueryExpression();

      qe.EntityName = "account";

     qe.ColumnSet = new Microsoft.Xrm.Sdk.Query.ColumnSet(true);

    Microsoft.Xrm.Sdk.EntityCollection ec = service.RetrieveMultiple(qe);

     

    It is retrieving all the Out of box attributes but not Custom Attributes. Any Idea...

     


    Hari
    Thursday, November 17, 2011 7:14 AM

Answers

  • So, what about a Fetch XML Expression ?

    Go to advanced find, build your query and download fetchxml - thats it.

     

    FetchXML = "" // Your code from the advanced find view & fetch xml
    
    FetchExpression expr = new FetchExpression(FetchXML);
                Microsoft.Xrm.Sdk.Messages.RetrieveMultipleRequest request = new Microsoft.Xrm.Sdk.Messages.RetrieveMultipleRequest()
                {
                    Query = expr
                };
              
                  // get the response
                Microsoft.Xrm.Sdk.Messages.RetrieveMultipleResponse response = (Microsoft.Xrm.Sdk.Messages.RetrieveMultipleResponse)service.Execute(request);
                EntityCollection results = response.EntityCollection;
    


    Thursday, November 17, 2011 7:47 AM

All replies

  • Hi Hari,

     

    Do you want to retrieve multiple accounts - or to retrieve multiple attributes of one account


    Thursday, November 17, 2011 7:40 AM
  • Hi,

    I want to retrieve Multiple accounts


    Hari
    Thursday, November 17, 2011 7:41 AM
  • So, what about a Fetch XML Expression ?

    Go to advanced find, build your query and download fetchxml - thats it.

     

    FetchXML = "" // Your code from the advanced find view & fetch xml
    
    FetchExpression expr = new FetchExpression(FetchXML);
                Microsoft.Xrm.Sdk.Messages.RetrieveMultipleRequest request = new Microsoft.Xrm.Sdk.Messages.RetrieveMultipleRequest()
                {
                    Query = expr
                };
              
                  // get the response
                Microsoft.Xrm.Sdk.Messages.RetrieveMultipleResponse response = (Microsoft.Xrm.Sdk.Messages.RetrieveMultipleResponse)service.Execute(request);
                EntityCollection results = response.EntityCollection;
    


    Thursday, November 17, 2011 7:47 AM
  • Thanks al lot..

    I helped me....:)

     


    Hari
    Thursday, November 17, 2011 9:05 AM