Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [promises]

A Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value.

0
votes
0answers
21 views

Using promises with aura component callbacks

I noticed there a number of questions listed regarding this topic but I don't have the time to parse through all of them and look for the relevant information. I was hoping someone could quickly ...
2
votes
1answer
49 views

How do I force a method to wait until a prior method has finished within a lightning controller?

In my controller I have an Init function that looks like this init: function (cmp, event, helper) { cmp.set('v.mycolumns', [ { label: 'Document Name', fieldName: 'Name', type: 'text'}, ...
0
votes
0answers
37 views

Component behaves differently in community vs internal

I have a component that displays a modal form using create component and a modal promise. In the community, it works as intended, where something occurs that fires the event that creates the ...
0
votes
1answer
72 views

Promise JS to handle Future Callout from Lightning Component

I am using Promise JS in my lightning component to make a server call. The apex class makes a callout to a external endpoint and returns the response to the component. This is working fine. After ...
1
vote
1answer
110 views

Multiple calls to lightning:quickActionAPI getAvailableActionFields() fails

I get an error when doing multiple calls to getAvailableActionFields in a Promise.all(). The markup: <aura:component implements="force:hasRecordId"> <lightning:quickActionAPI aura:id="...
5
votes
1answer
116 views

Failing to conditionally render Lightning component after setting value from Promise callback

The Goal I am trying to conditionally render a component after a user successfully uploads a CSV file. Here is the markup for the conditional rendering. Details have been omitted: <!-- Create ...
0
votes
0answers
25 views

Using Promise to control execution

I have a a client side controller that calls an async method that determines status from the server side. Based on the response I want to either stop further execution or carry on to next steps (if ...
1
vote
1answer
410 views

$A.createComponent not firing when loading component dynamically

I have a parent custom component which loads child custom components dynamically to create a non linear interview/wizard process. The child component has aura:valueInit method: <aura:handler name=...
1
vote
1answer
159 views

Error: Definition does not exist on the client for descriptor - when using JavaScript Promises

I am getting this error message when dynamically adding a lightning component: Definition does not exist on the client for descriptor:markup://c:MyCustomLightningComponent. Client side caches ...
2
votes
1answer
271 views

JavaScript Promise Chaining in lightning component has transaction issue in server side

I have a requirement , where I want to call server methods multiple times passing some value as parameter. I have used javascript promise to call the methods one after another using .then When I am ...
2
votes
1answer
112 views

How to use Promises to kick off one helper method after another one is completed?

I've got these two helper methods: submitBookingInformation: function(component, event, helper) { helper.createLead(component, event, helper); helper.saveRecord(component, event, helper); } ...
7
votes
2answers
201 views

Do Lightning callbacks (in Promises) get their own scope/governor limits

My apps use promises (using the Lax library) quite heavily and I have seen that different callbacks often produce their own log in the Dev Console. Does this mean that: Each callback gets its own ...
8
votes
2answers
2k views

How to make code which uses Lightning promises look more synchronous

When I read about promises, I see that they should appear as solution to prevent callback hell and pyramid of doom but when I actually try to write a code which would use Lightning promises it still ...
2
votes
1answer
426 views

Why Lightning supports Promises but doesn't support ES6 Generators?

There are several articles which suggest that Lightning support Promises with a polyfill, but still ES6 generators are not supported. Prove me if I am wrong. What is the point of supporting Promises ...
3
votes
1answer
372 views

Promise and access to access=private attributes

I am trying to use Promise to make my code more readable and efficient but I'm stuck with the inability to get/set private attribute values. Consider the following example: <aura:component> ...
5
votes
1answer
73 views

Can a Promise be passed as an attribute of a Lightning Component application event?

I am attempting (but failing - getting undefined when the event is handled) to pass a Promise returned by a lightning:workspaceAPI getEnclosingTabId call as an attribute of an application event. Do ...
1
vote
2answers
367 views

Need help with Promises in lightning

In my Lightning application I need some helpers to make their calls after others have completed, so I'm trying to implement promises to make that happen in my init function: doInit : function(...
2
votes
1answer
275 views

Lightning spinner doesn't show up in Promise setting

In the init() function of my Lightning component <aura:component> <aura:handler name="init" value="{!this}" action="{!c.init}" /> <c:spinner aura:id="spinner" /> ......
14
votes
1answer
2k views

Simple example on how to use Promises to call @AuraEnabled Apex methods?

In the Lightning Component Developer Guide you can find that Promises can be used in Lightning Components and what special things we need to care for to make them work. But there is no fully working ...
1
vote
0answers
148 views

jsforce Apex REST call fails in IE11 only. ES6 Promise support issue?

I am calling a custom Apex REST endpoint from JS in a custom VF component within a VF page using the jsforce library, and everything works as expected in Edge, Chrome, Firefox, but not IE11. It seems ...
2
votes
1answer
255 views

How to return a promise from a component's public method?

Situation I'm calling a public method from a child component. The method runs, but it's supposed to return a promise. Instead, it returns nothing. Code Parent markup: <aura:component> <...
3
votes
1answer
558 views

Using Promises in Lightning components

I'm trying to move a synchronous call in a lightning component to use ES6 promises. I have an API returning an array of JSON objects that is hosted on Heroku and want to call that into a lightning ...
4
votes
1answer
160 views

Storable actions and promises

From the salesforce promise documentation: Don’t Use Storable Actions in Promises The framework stores the response for storable actions in client-side cache. This stored response can ...