locked
Linked entity getting error: The 'RetrieveMultiple' method does not support entities of type 'none'. RRS feed

  • Question

  • Hi,

    Linked query

    IOrganizationService_service;

               

    CrmServiceHelperserviceHelper = newCrmServiceHelper();

                _service = serviceHelper.GetService();

               

    intintPageCount = Convert.ToInt16(ConfigurationManager.AppSettings["PageCount"]);

               

    List<TemplateDetails> templateDetailsList = newList<TemplateDetails>();

               

    try


                {

                    {

                       

    IEnumerable<string> butemplates;

                       

    // Create the column set that indicates the fields to be retrieved.


                        #region

    Commented by Ammiti

                        Microsoft.Xrm.Sdk.Query.

    QueryExpressionquery = newMicrosoft.Xrm.Sdk.Query.QueryExpression();

                        query.EntityName =

    "new_emailtemplatemapping";

                        query.ColumnSet =

    newMicrosoft.Xrm.Sdk.Query.ColumnSet("new_emailtemplateid");

                        Microsoft.Xrm.Sdk.Query.

    ConditionExpressioncond1 = newMicrosoft.Xrm.Sdk.Query.ConditionExpression("new_businessunit", Microsoft.Xrm.Sdk.Query.ConditionOperator.Equal);

                        cond1.Values.Add(BUGuid);

                        query.Criteria.AddCondition(cond1);

                       

    EntityCollectioncollection1 = _service.RetrieveMultiple(query);

                       

    List<string> lst = newList<string>();

                       

    foreach(Entityen incollection1.Entities)

                        {

                            lst.Add(en.Attributes[

    "new_emailtemplateid"].ToString());

                        }



                        #endregion


                       

    // Create the QueryExpression object.


                        Microsoft.Xrm.Sdk.Query.

    QueryExpressionquery1 = newMicrosoft.Xrm.Sdk.Query.QueryExpression();

                        query.EntityName =

    "template";

                        query.ColumnSet =

    newMicrosoft.Xrm.Sdk.Query.ColumnSet("title", "description", "templatetypecode", "ispersonal");

                        Microsoft.Xrm.Sdk.Query.

    ConditionExpressioncond2 = newMicrosoft.Xrm.Sdk.Query.ConditionExpression("templateid", Microsoft.Xrm.Sdk.Query.ConditionOperator.In,lst.ToArray());

                       

    // cond2.Values=;


                        query1.Criteria.AddCondition(cond2);

                       

    //


                       

    EntityCollectioncollection = _service.RetrieveMultiple(query1);

                       

    //  _service.RetrieveMultiple(retrieve);


                       

    // Execute the request.


                       

    if(collection.Entities.Count > 0)

                        {

                            templateDetailsList = (

    frombe incollection.Entities

                                                  

    selectnewTemplateDetails


                                                   {

                                                       Id =

    newGuid(be.Attributes["templateid"].ToString()),

                                                       title = be.Attributes.Contains(

    "title") && be.Attributes["title"] != null? be.Attributes["title"].ToString() : string.Empty,

                                                       description = be.Attributes.Contains(

    "description") && be.Attributes["description"] != null? be.Attributes["description"].ToString() : string.Empty,

                                                       Type = be.Attributes.Contains(

    "templatetypecode") && be.Attributes["templatetypecode"] != null? be.Attributes["templatetypecode"].ToString() : string.Empty,

                                                       IsPersonal = be.Attributes.Contains(

    "ispersonal") && be.Attributes["ispersonal"] != null? Convert.ToBoolean(be.Attributes["ispersonal"].ToString()) : false,

                                                   }).ToList<

    TemplateDetails>();

                        }

                       

    else


                        {

                           

    returnnull;                      

                        }

                    }

    it's saying that

    The 'RetrieveMultiple' method does not support entities of type 'none'.

    can you pls suggest on this



    Rammohan

    Thursday, March 27, 2014 4:18 AM

All replies

  • On which line is the error - you are submitting more than one RetrieveMultiple ?

    The most likely cause is the query on the template entity - it may be that CRM requires that you filter the templates based on the templatetypecode, though I've not come across this before


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

    Thursday, March 27, 2014 8:12 PM
    Moderator