web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

getting “Enumeration yielded no results” error in LINQ statement

(0) ShareShare
ReportReport
Posted on by 3,634

I'm getting the "Enumeration yielded no results" in the following statement. Please I don't what went wrong:

QueryByAttribute query = new QueryByAttribute()
                    {
                        
                        EntityName = "duplicaterecord",
                        ColumnSet = new ColumnSet(true)
                    };

                    query.Attributes.Add("asyncoperationid");
                    query.Values.Add(_response.JobId);
                    EntityCollection en_Col = sp.RetrieveMultiple(query);

                    //// check to make sure each id is found in the collection
                    var duplicateIds = en_Col.Entities.Select((entity) => ((DuplicateRecord)entity).BaseRecordId.Id);

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    anilambadan Profile Picture
    1,160 on at

    Hi

    Please check whether you got any records back from the retrieveMultiple method

    please check like en_Col.Entities.count

    thanks

    Anil

  • Mohsin Ali Profile Picture
    3,634 on at

    Thank You Anil for your response.

    Actually, the behavior is a bit strange. Whenever a new record is created it behaves like this but after a few minutes like 20-25 it behavior get normal.

  • Verified answer
    Mohsin Ali Profile Picture
    3,634 on at

    Anil, I'm done with it. here is the updated snippet.

    if(en_Col.Entities.Count > 0)

    {

    var duplicateIds = en_Col.Entities.Select((entity) => ((DuplicateRecord)entity).BaseRecordId.Id);

    }

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans