Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

OData to Organization service

Posted on by Microsoft Employee

Hi all,

I have this Odata query to retrieve events and I want to convert it to IOrganizationservice retriev code

Query 

/datatel_events?$filter=datatel_eventstart%20ge%202016-08-17‌ T15:00:00Z%20and%20_‌ datatel_eventcodeid_‌ value%20eq%20529c964‌ 5-34f4-e411-80df-0af‌ 087926152 

Thanks.

*This post is locked for comments

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: OData to Organization service

    Hello,

    Here is how your code can look like:

               var query = new QueryExpression("datatel_event")

               {

                   ColumnSet = new ColumnSet(true)

               };

               query.Criteria.AddCondition("datatel_eventstart", ConditionOperator.GreaterEqual, new DateTime(2016, 08, 17, 15, 0, 0));

               query.Criteria.AddCondition("datatel_eventcodeid", ConditionOperator.Equal, new Guid("529c964‌5-34f4-e411-80df-0af‌087926152"));

               var records = service.RetrieveMultiple(query).Entities;

  • Suggested answer
    Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: OData to Organization service

    You can use the QueryExpression class to construct the query and pass the query to the RetrieveMultiple method. Here's an example: msdn.microsoft.com/.../gg334688.aspx

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