Skip to main content

Notifications

Announcements

No record found.

Customer Service forum

How to make Xrm.WebApi call Synchronous in v9.0?

Posted on by

Hi,

As title, syntax is here

Xrm.WebApi.retrieveRecord(entityLogicalName, id, options).then(successCallback, errorCallback);

Thanks for any sharing.

Note:

I am not asking about the v8.2, so please do not give me example as

var req = new XMLHttpRequest();

req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/xxx", false);

Regards,

Categories:
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to make Xrm.WebApi call Synchronous in v9.0?

    On Success callback, we can loop through each of the retrieved records and perform async operations on them

  • Suggested answer
    Jan Kostejn Profile Picture
    Jan Kostejn 55 on at
    RE: How to make Xrm.WebApi call Synchronous in v9.0?

    Hi,

    I came across the same issue. I wanted to get field and work with it. But the field was in linked entities and I didn't like nesting specific calls. So I made my own solution, which can be parameterized from outside:

    blog.thenetw.org/.../making-xrm-webapi-retrieverecord-synchronous-calls-in-common-data-service-d365-fo-ce

  • Verified answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: How to make Xrm.WebApi call Synchronous in v9.0?

    Are you able to solve it?

    Refer this:

    arundynamix.blogspot.com/.../xrmwebapi-call-synchronous-in-v9.html

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to make Xrm.WebApi call Synchronous in v9.0?

    I am having a tough time figuring out how this works in the case of RetrieveMultiple

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: How to make Xrm.WebApi call Synchronous in v9.0?

    Unfortunately it’s not straight forward like regular Ajax call with a bool flag.

    If you want to have a series of calls sequentially, you have to do nested success callback. ie chain of Async calls. It’s basically going to return a Promise object & will be executed in browser.

    github.com/.../150

  • RE: How to make Xrm.WebApi call Synchronous in v9.0?

    +1 from me, i couldn't find so far, i think it is only async.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

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