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="...
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 ...
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 ...
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 ...
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 ...
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 ...
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,
...
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+...
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 ...
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/...
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 = ...
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 ...
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 ...
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 ...
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 ...
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);
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
promises × 41javascript × 13
sharepoint-online × 12
jquery × 10
jsom × 7
2013 × 6
rest × 6
spfx × 6
sharepoint-enterprise × 5
client-object-model × 4
sharepoint-addin × 3
spfx-webparts × 3
angularjs × 3
sharepoint-rest-api × 2
caml-query × 2
jslink × 2
ajax × 2
client-side-rendering × 2
sharepoint-framework × 2
typescript × 2
pnp-js-core × 2
sharepoint-designer × 1
list × 1
sharepoint-foundation × 1
office-365 × 1