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)

Retrieve single record with condition using query expression

(0) ShareShare
ReportReport
Posted on by

Hi All,

Quick question 

I want to retrieve a record with a where condition , I know this query will return me a single record.

I know how to do it using Query Expression and the service.RetrieveMultiple .

Is there any way I can add a filter condition with service.Retrieve too?

If no , then is using service.RetrieveMultiple the most accurate way for writing such a query.

Thanks 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Kokulan Profile Picture
    18,054 on at

    Hi

    You cannot specify condition for service.Retrieve as it retrieves record based on the ID (GUID) you provided so it does not need any condition.

    If you are retrieving by conditions and filters (meaning you do not know the ID of the record at that point in time), and yes you have to use service.RetrieveMultiple even if you are expecting only one record.

    Please note that If your query is going to run from outside of CRM, Web Api is recommended over WCF endpoint

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