Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Retrieve - ODATA

Posted on by 690

Good afternoon,

We are running a query using $ filter, with a parameter and it is working, however need to insert the AND clause because we will use several parameters ... how do we proceed?

Follow the code that we are using

$ Filter = order_customer_accounts / Name% 20eq% 20% 27ACCOUNT% 27 & AND
$ Filter = order_customer_accounts / Name% 20eq% 20% 27ACCOUNT2% 27% &

Thank you

*This post is locked for comments

  • Verified answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Retrieve - ODATA

    Hi Ricardo,

    You were asking how to put multiple parameters using AND clause and you got your answer. It's really hard to understand your question now - why are you getting only one account? Because only one account satisfied your conditions that you've put in the query. You did not explain what you want to achieve or shared with us some data example that you want to query for, so I'm guessing that you should close this thread and start new one not to make chaos on the forum with too long topics having multiple different questions inside.

  • RE: Retrieve - ODATA

    I did not understand, could you give me an example or be clearer please?

  • Suggested answer
    M.T. Eikelenboom Profile Picture
    M.T. Eikelenboom 5,241 on at
    RE: Retrieve - ODATA

    Shouldn't it be OR in stead of AND if you want to bring back two records and filter on the same property?

  • RE: Retrieve - ODATA

    Hello Alagu,

    Tanks for your answer.

    Inflectively is bringing only the data of the first account does not bring the data of the second.

  • Suggested answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: Retrieve - ODATA

    Hi

    If you got answer.Could you please close the thread?

  • Suggested answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: Retrieve - ODATA

    $ Filter = order_customer_accounts / Name% 20eq% 20% 27ACCOUNT% 27 & AND order_customer_accounts / Name% 20eq% 'second account name '

  • RE: Retrieve - ODATA

    Tank you,

    And after the end would be the second account?

  • Suggested answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: Retrieve - ODATA

    Hi Ricardo,

    Correct one is $ Filter = order_customer_accounts / Name% 20eq% 20% 27ACCOUNT% 27 & AND

    Please refer below link,

    msdn.microsoft.com/.../gg309461(v=crm.7).aspx

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Retrieve - ODATA

    Hi,

    I would suggest using some tool for building queries for example:

    github.com/.../CRMRESTBuilder

    I'm not sure what;s the problem with this and clause. And clause in filter is just "and" :) sor for example:

    filter=Country_Region_Code eq 'ES' and Payment_Terms_Code eq '14 DAYS'

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans