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...
Answered

Xrm.WebApi.online.retrieveMultipleRecords no response

(0) ShareShare
ReportReport
Posted on by 10

Hi ,

I am unable to get any response from the Xrm.WebApi.online.retrieveMultipleRecords.using CRM Rest builder.

Below is the snippet

Xrm.WebApi.online.retrieveMultipleRecords("appointment", "?$select=subject,activityid,_createdby_value,createdon,scheduledend,scheduledstart&$filter=_regardingobjectid_value eq '" + opportunityId + "'and statecode ne 1 and statecode ne 3 and contains(subject, 'Week')").then(

Thanks

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Xrm.WebApi.online.retrieveMultipleRecords no response

    Hi EKL,

    I have created one appointment as your conditions:

     pastedimage1627960097850v1.png

    (1) Regarding field related to the opportunity--01(3e6166e1-c2c9-eb11-bacc-002248096605)

    (2) State is open --statecode is 0

    pastedimage1627960192561v2.png

    (3) Subject field contains 'Week'.

    Then i used same filter to retrieve appointments:

    Xrm.WebApi.online.retrieveMultipleRecords("appointment", "?$select=activityid,_createdby_value,createdon,scheduledend,scheduledstart,subject&$filter=_regardingobjectid_value eq 3e6166e1-c2c9-eb11-bacc-002248096605 and  statecode ne 1 and  statecode ne 3 and contains(subject, 'Week')").then(
    Result:
    pastedimage1627960376488v3.png

    So you need to check all appointments to see if any exist that meet all the conditions.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • EKL Profile Picture
    10 on at
    RE: Xrm.WebApi.online.retrieveMultipleRecords no response

    Thank you, Can you please let me know the code you used to retrievemultiple or how to do via CRM REST Builder.

    pastedimage1627984907980v1.png

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Xrm.WebApi.online.retrieveMultipleRecords no response

    Hi EKL,

    I have built api in CRM REST Builder as following screenshot:

    pastedimage1628055334972v1.png

    Then i got following code:

    pastedimage1628056278336v1.png

    Xrm.WebApi.online.retrieveMultipleRecords("appointment", "?$select=activityid,_createdby_value,createdon,scheduledend,scheduledstart,subject&$filter=_regardingobjectid_value eq 3e6166e1-c2c9-eb11-bacc-002248096605 and  statecode ne ne and  statecode ne ne and contains(subject, 'Week')").then(
        function success(results) {
            for (var i = 0; i < results.entities.length; i  ) {
                var activityid = results.entities[i]["activityid"];
                var _createdby_value = results.entities[i]["_createdby_value"];
                var _createdby_value_formatted = results.entities[i]["_createdby_value@OData.Community.Display.V1.FormattedValue"];
                var _createdby_value_lookuplogicalname = results.entities[i]["_createdby_value@Microsoft.Dynamics.CRM.lookuplogicalname"];
                var createdon = results.entities[i]["createdon"];
                var scheduledend = results.entities[i]["scheduledend"];
                var scheduledstart = results.entities[i]["scheduledstart"];
                var subject = results.entities[i]["subject"];
            }
        },
        function(error) {
            Xrm.Utility.alertDialog(error.message);
        }
    );

    But i found some errors in code(I'm not sure what the reason is), so i can't execute it in CRM REST Builder.

    pastedimage1628055548165v3.png

    So i copy the URL:

    pastedimage1628055828544v6.png

    Change the errors:

    orgxxxxxxx.crm.dynamics.com/.../appointments

    Paste it to the URL bar of the browser, then you can get response:

    pastedimage1628056169706v7.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • AriaConsulting Profile Picture
    2 on at
    RE: Xrm.WebApi.online.retrieveMultipleRecords no response

    , how do you come up with this so fast??  Wow!

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 365 | Integration, Dataverse, and general topics

#1
#ManoVerse Profile Picture

#ManoVerse 101

#2
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 66 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans