locked
How can we DynamicEntityRetrieve a multiple Dynamic Entity using Plugins RRS feed

  • Question

  •  

    Hi Every body,

     

    I have a cusotomized entity "new_phonenumber" containt a phone number of customer.

    i want to retrive multiple record of "new_phonenumber" using plugins to do same job. But in SDK i find just how to DynamicEntityRetrieve (One record), i triyed to use

    RetrieveMultipleResponse and BusinessEntityCollection to retrive multiple record but CRM return an exeption :

     

    The was an error generating the XML document

     

    some body help me to retrieve a multiple dynamic entities

     

    thx,

    Saturday, January 17, 2009 2:25 PM

Answers

  •  

    try

    QueryExpression query = new QueryExpression();
                        query.EntityName = "new_phonenumber";

                        query.ColumnSet = new AllColumns();
                        FilterExpression filter = new FilterExpression();
                        filter.FilterOperator = LogicalOperator.And;

                        filter.Conditions.Add( new ConditionExpression([your condition]);
                               
                        query.Criteria = filter;
                        RetrieveMultipleRequest request = new RetrieveMultipleRequest();
                        request.Query = query;
                        request.ReturnDynamicEntities = true;

     

                        RetrieveMultipleResponse response = (RetrieveMultipleResponse)service.Execute(request);

    foreach (BusinessEntity businessentity in response.BusinessEntityCollection.BusinessEntities)
              {

    }

    Saturday, January 17, 2009 6:03 PM

All replies

  •  

    try

    QueryExpression query = new QueryExpression();
                        query.EntityName = "new_phonenumber";

                        query.ColumnSet = new AllColumns();
                        FilterExpression filter = new FilterExpression();
                        filter.FilterOperator = LogicalOperator.And;

                        filter.Conditions.Add( new ConditionExpression([your condition]);
                               
                        query.Criteria = filter;
                        RetrieveMultipleRequest request = new RetrieveMultipleRequest();
                        request.Query = query;
                        request.ReturnDynamicEntities = true;

     

                        RetrieveMultipleResponse response = (RetrieveMultipleResponse)service.Execute(request);

    foreach (BusinessEntity businessentity in response.BusinessEntityCollection.BusinessEntities)
              {

    }

    Saturday, January 17, 2009 6:03 PM
  • Thx You so much Naitik
    Sunday, January 18, 2009 8:05 AM