web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: Odata ?$select=""&$filter - How to work with or operator?

    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
    RE: Odata ?$select=""&$filter - How to work with or operator?

    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
    RE: Odata ?$select=""&$filter - How to work with or operator?

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

  • Ky0l Profile Picture
    10 on at
    RE: Odata ?$select=""&$filter - How to work with or operator?

       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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 169

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 65

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 63 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans