3 votes

How to use jquery promise in JSOM

You don't necessarily need to use a promise here, just don't try to set the value of the HTML element until after you get your result. So in your default.aspx: <asp:Label id="LabelA" runat="...
Dylan Cristy's user avatar
  • 12.7k
3 votes
Accepted

How to perform nested CAML operations using promises?

First, I'm guessing that the log of Display of all incidents for... is happening multiple times because it is on the same line as the closing bracket of the inner while loop. Try moving that down to ...
Dylan Cristy's user avatar
  • 12.7k
3 votes
Accepted

Can I check out, update, and check in with 1 REST call?

Yes, you need to make 3 REST calls. One for checking out the item, second for updating the item, third for checking in the item. I presume you know that you actually need to make another REST call ...
Mihail's user avatar
  • 2,099
3 votes
Accepted

SP Online - Use promises in SharePoint-Hosted Add-in

You have the right idea, and I went ahead and cleaned up the structure. In general, the goal of promises is to make asynchronous programming more like procedural programming. In general, you'll have a ...
boothinator's user avatar
2 votes
Accepted

Using SharePoint 2013 PeoplePicker with jQuery promise

// Run your custom code when the DOM is ready. $(document).ready(function () { initializePeoplePicker('peoplePickerDiv'); }); // Render and initialize the client-side People Picker. function ...
Sunil Sahu's user avatar
  • 1,768
2 votes
Accepted

SharePoint JSOM and Promises - copying items from one list to another

At first glance (and its late saturday afternoon here, and the sun is out and its above 20 celcius for the first time, and I have had some beer) You are running into JavaScrip scoping issues: var ...
Danny '365CSI' Engelman's user avatar
2 votes

Problems getting executeQueryAsync to work with Promise

ctx.executeQueryAsync(function() { dfd.resolve(onQuerySucceeded); },onQueryFailed); Closely read what you are doing here: You are (immediatly) resolving a Promise with a Function declaration, ...
Danny '365CSI' Engelman's user avatar
2 votes

Javascript, promise, when all operations are done

Not entirely sure how you initialize the deferred function calls, but $.when.apply is the key here. var promises = []; var rows = e.target.result.split("\n"); for (var i = 0; i < rows.length; i+...
Jussi Palo's user avatar
  • 8,196
2 votes
Accepted

SharePoint Framework with Promise in extension

I didn't test this code but it should be mostly right. It's enough to give you the idea of what you need to do. There is an asynchronous call to getMenus inside the body of the _getPlaceholderHtml ...
Rob Windsor's user avatar
  • 12.6k
2 votes
Accepted

How to use Promise.all and ForEach to make ajax call per array item?

JQuery AJAX does not use native JS promises. You can observe this by the way they defined a success and error callback. You can explore using fetch https://developer.mozilla.org/en-US/docs/Web/API/...
Cardin's user avatar
  • 136
2 votes

How to use jquery promise in JSOM

Here's an example of how to wrap a JSOM call in a jQuery promise. You should be able to modify the code above to use the same calling pattern. function getListsCsomJquery(rowLimit) { var dfd = ...
Rob Windsor's user avatar
  • 12.6k
2 votes
Accepted

Making MsGraphClient request synchronous (await)

Changing the function to return a resolved promise works as expected: public getDirectReports = async (manager): Promise<any[]> => { console.info(`** 2 - /me/directReports`); return ...
Nigel Witherdin's user avatar
1 vote

Making MsGraphClient request synchronous (await)

An async from function needs to return a Promise, then resolve that Promise. Thankfully, React makes things a little easier for you. If you return a Promise, then later in your function body return ...
willman's user avatar
  • 3,724
1 vote
Accepted

How to skip a failed api lookup and pass null parameters instead?

In the case the SiteUrl is nonexistent or invalid, your then promise resolution should still fire, but the data parameter passed to it will likely either contain an error object, or at least not ...
willman's user avatar
  • 3,724
1 vote
Accepted

Using SPServices with Datatables: Table loads before SPServices GetListItem call is finished running

You can use Promises and Deferreds to implement the asynchronous nature in the call. This way the table building activity will start only after fetching the list items. The Skeleton of the call is ...
Priyaranjan KS's user avatar
1 vote
Accepted

SharePoint Apps and Promises / Deferred when performing work on data

As your restHelper.peopleSearchQuery(options);is a promise, you can call that function and add a then() which in turn calls drawUserData restHelper.peopleSearchQuery(options).then(drawUserData);
Colin's user avatar
  • 4,665

Only top scored, non community-wiki answers of a minimum length are eligible