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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Odata ?$select=""&$filter - How to work with or operator?

(0) ShareShare
ReportReport
Posted on by 10

Hello all & Happy Friday,

I'm trying to append an OR operator to this working JS and cannot find many examples in D365 online.

Following: https://community.dynamics.com/365/b/goutamdas/posts/how-to-pass-multiple-guid-in-xrm-webapi-retrievemultiplerecords

and using error checking from Visual studio code I've gone from:

Working: 

Xrm.WebApi.retrieveMultipleRecords("red_subjectivity""?$select=red_name&$filter=_red_binder_value eq " + recordId).then(

TO

Not Working: 
Xrm.WebApi.retrieveMultipleRecords("red_subjectivity""?$select=red_name&$filter=_red_binder_value eq " + recordId + or ('red_status eq') ("283390001")).then(


Objective: To add an OR statement for the record status eq to "283390001"

Thanks for all your help and guidance on the matter. :)
I have the same question (0)
  • Suggested answer
    Carlos Eduardo Fontolan Profile Picture
    on at

    Hello KyOl, 

    I hope you are doing well. 

    I believe that this 3rd party tool named FetchXml Builder can help to to perform it https://fetchxmlbuilder.com/features/ into XRMToolBox that you can see more details here https://www.xrmtoolbox.com/ 

    Also you can work with CRM Rest Builder solution https://github.com/jlattimer/CRMRESTBuilder 

    Kind Regards, 

  • Suggested answer
    PabloCRP Profile Picture
    1,088 on at

    hi,

    try like this

    "?$select=red_name&$filter=(_red_binder_value eq "   recordId  " or red_status eq 283390001)"

    if red_status is a string value then surround '283390001' if it's a number value then let it as example above.

  • Ky0l Profile Picture
    10 on at

    Didn't quite work, however a consultant is looking at it tomorrow and will post the results. :)

  • Ky0l Profile Picture
    10 on at

       Xrm.WebApi.retrieveMultipleRecords("red_subjectivity", "?$select=red_name,red_status&$filter=_red_binder_value eq " + recordId).then(

           function success(result) {

               var subgridLength = result.entities.length;

               if (subgridLength == 0) {

                   if (formContext.getControl('red_status') != null)

                   formContext.getControl('red_status').removeOption(283390002); //Hide "Approved with Subjectivities" value

               }

               else if (subgridLength > 0) {

                   for (var i = 0; i < subgridLength; i++) {

                       if (result.entities[i]["red_status"] != 283390001 && formContext.getControl('red_status') != null) {

                           formContext.getControl('red_status').removeOption(283390003); //Hide "Approved" value

                       }

                   }

               }

           },

           function (error) {

               alert("Failure");

               console.log(error.message);

           }

       );

    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 156

#2
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans