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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer Service forum

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

(0) ShareShare
ReportReport
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:
I have the same question (0)
  • Jeevan Kumar Balija Profile Picture
    425 on at

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

  • Suggested answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at

    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

  • Community Member Profile Picture
    on at

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

  • Verified answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at

    Are you able to solve it?

    Refer this:

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

  • Suggested answer
    Jan Kostejn Profile Picture
    55 on at

    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

  • Community Member Profile Picture
    on at

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

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

News and Announcements

Season of Giving Solutions is Here!

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 > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans