Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

Posted on by 235

In a QueryExpression I m trying to use Or operator and retrieve multiple records. When I ran my query it through below error:

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

My code is as below:

public void Execute()
        {
            CrmConnection conn = new CrmConnection("CRMOnline");
            IOrganizationService org = new OrganizationService(conn);


            QueryExpression userQ = new QueryExpression()
            {

                Criteria =
                {
                    Filters = { 
                            new FilterExpression {
                             FilterOperator = LogicalOperator.Or,
                              Conditions = { 
                              new ConditionExpression("fullname",ConditionOperator.Equal,"Mian sb")
                              }
                            },
                            new FilterExpression {
                             FilterOperator = LogicalOperator.Or,
                              Conditions = { 
                              new ConditionExpression("fullname",ConditionOperator.Equal,"Papa Phindi")
                              }
                            },
                            new FilterExpression {
                             FilterOperator = LogicalOperator.Or,
                              Conditions = { 
                              new ConditionExpression("fullname",ConditionOperator.Equal,"Mai Lghoom")
                              }
                            }
                            
                             
                    }
                }
            };

            var results = org.RetrieveMultiple(userQ);




        }


Can you please suggest what I m doing wrong and what I should do to fix it ?

Please feel free to give any suggestion but since it is a demo for my learning I want to do it using QueryExpressin. 

Thanks a lot for your time and help.

*This post is locked for comments

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: The 'RetrieveMultiple' method does not support entities of type 'none'.

    Hi,

    You forgot to specify Entity Name onw which you want to execute query.

    Please mention Entity name in QueryExpression userQ = new QueryExpression("EntityName for example lead")

    Or you can specify Entity property as mentioned by mehmet

  • Suggested answer
    mehmetseckin Profile Picture
    mehmetseckin 130 on at
    RE: The 'RetrieveMultiple' method does not support entities of type 'none'.

    You should specify the logical name of the entity you're querying the records for:

    QueryExpression userQ = new QueryExpression()
    {
        EntityName = "contact", // Look for contact records...
        Criteria =
        {
            Filters = { 
                    new FilterExpression {
                        FilterOperator = LogicalOperator.Or,
                        Conditions = { 
                        new ConditionExpression("fullname",ConditionOperator.Equal,"Mian sb")
                        }
                    },
                    new FilterExpression {
                        FilterOperator = LogicalOperator.Or,
                        Conditions = { 
                        new ConditionExpression("fullname",ConditionOperator.Equal,"Papa Phindi")
                        }
                    },
                    new FilterExpression {
                        FilterOperator = LogicalOperator.Or,
                        Conditions = { 
                        new ConditionExpression("fullname",ConditionOperator.Equal,"Mai Lghoom")
                        }
                    }
                    
                        
            }
        }
    };

  • umma Profile Picture
    umma 235 on at
    RE: The 'RetrieveMultiple' method does not support entities of type 'none'.

    Thanks Guido Preite.

    "normally I don't do inline syntax", what is prefeed way for this ? Do you suggest declare seprately and spacify in a seprate line of code ?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans