Questions tagged [asynchronous]

An asynchronous process is a process or function that executes a task "in the background" without the user having to wait for the task to finish. Typically, you will use Asynchronous programming for callouts to external systems, operations that require higher limits, and code that needs to run at a certain time.

Filter by
Sorted by
Tagged with
2 votes
1 answer
1k views

Do outbound messages block trigger?

Based on Triggers and Order of Execution document, it is unclear at which point outbound messages are executed: 10. Executes workflow rules. <..> 19. Commits all DML operations to the database. ...
dzh's user avatar
  • 4,016
2 votes
2 answers
2k views

Does Platform Event / CDC uses same Async queue as Queueable/ Future?

We have a huge concurrent influx of incoming custom api requests. (1000+ under 5 seconds approx) Because of this we were getting ConcurrentPerOrgLongTxn Limit exceeded. We moved from Sync processing ...
Nagendra Singh's user avatar
2 votes
1 answer
1k views

How to tell my lightning web component the data has been loaded through a mix of imperative and @wire operations

TL;DR whats the best way to tell a page that the underlying data has loaded through a mix of imperative calls and wire calls, preferably without chaining .then functions Long Version: I have 4 async ...
TemporaryFix's user avatar
  • 2,887
2 votes
1 answer
484 views

The future of Async Apex - everything Queueable?

I know that this is a somewhat opinion based question but there is definitely interest in the community in where the Roadmap goes. Do I get the blogs and communities and blogs right that we are ...
Robert Sösemann's user avatar
2 votes
1 answer
2k views

Apex Batch Job not processing all batches

I have an apex batch job, to query all closed cases older than 13 months. I have implemented the Stateful interface to that I can accumulate all the rows over the several batches that will execute. ...
cloudy-ritz's user avatar
  • 2,583
2 votes
1 answer
1k views

"Cannot execute the continuation for Web Service calls" error when using an Asynchronous Callout

Working through a quick example of using a Continuation to make an async web service callout produced the following error after pressing the apex:commandButton that called the action returning the ...
Daniel Ballinger's user avatar
2 votes
2 answers
3k views

Asynchronous Apex-->Future Method challenge

I am doing the challenge for 'Asynchronous Apex-->Future Method' module and have written following apex classes: public class AccountProcessor { @future public static void countContacts (List&...
madajee's user avatar
  • 21
2 votes
1 answer
560 views

RequestAnimationFrame in LWC

I'm implementing a pretty straight-forward animation in LWC (Lightning Web Components). My normal approach to doing animations within JS is to use requestAnimationFrame, but the linter rules in LWC ...
Mattisdada's user avatar
  • 1,071
2 votes
1 answer
10k views

Solution on Calling queueable from Batch causing exception of "System.LimitException: Too many queueable jobs added to the queue: 2"

Have any one of you come across a situation, where I need to call queueable class from batch. To give you more details, let us a scenario - I have a scheduler, which will run after particular time of ...
Ysr Shk's user avatar
  • 3,104
2 votes
1 answer
1k views

Asynchronous calls from VF page to controller method

On a visualforce page that I created to upload documents, I tried to upload 500 documents at once. But it always exceeds the CPU time limit. Is there a way to invoke controller method Asynchronously ...
HEnry Li's user avatar
2 votes
1 answer
719 views

Queuable Apex - chaining jobs vs calling other classes synchronously

I'm learning Queueable apex and want to make sure I understand what the benefit of chaining jobs is, as opposed to simply calling other class methods within the method synchronously. Here's my ...
Lachlan B's user avatar
  • 313
2 votes
2 answers
1k views

Why do batches behave different in Production than in a Sandbox

Recently I observed serious and undocumented differences in the runtime behaviour of Sandbox vs. Production orgs, e.g.: Batches (same code, same data) run faster in the Sandbox Same Batch in Sandbox ...
Robert Sösemann's user avatar
2 votes
1 answer
172 views

Heuristics to decide if to run an operation sychronous or asynchronous

Im our app we recently had to switch many operations from short running synchronous calls to asychronous Batch or future calls. It helps us overcome the many limits but also introduces many other ...
Robert Sösemann's user avatar
2 votes
2 answers
859 views

Queueable being called from a trigger by an Asynchronous Process

Recently we moved our logic in our trigger to be asynchronous and now the helper method that the triggers call looks something like this (specifics obfuscated since it's company code): global static ...
J. Larson's user avatar
2 votes
1 answer
905 views

What exactly is "Extended Delay" in the context of Batch Apex?

Just noticed in the Salesforce Technical Library: Asynchronous Processing in Force com it says: Fair Request Handling Since all of the requests in the peek set are from a single organization (...
Matt and Neil's user avatar
2 votes
1 answer
3k views

Update VisualForce Page field after Apex future callout

Want to update a VisualForce Page once my @future Apex Callout is done. How can I update a VisualForcePage, once the Webservice callout is done? Could I somehow divide the SearchCRM method, so that it ...
Claus Machholdt's user avatar
2 votes
1 answer
688 views

How can I make multiple Http callouts in a row?

I need to build an apex class that will perform multiple callouts in a row to an external system and upsert some records. Right now I'm sending a POST method with a query in the body and getting an ...
Leonardo dos Santos Zamboni's user avatar
2 votes
1 answer
977 views

Testing asynchronous flow in Apex test method

I am somewhat vexed by this and I would like a little guidance. I have a flow that fires on record create or update and I have written an Apex test class to test that it works as intended. I have set ...
d-fws's user avatar
  • 23
2 votes
1 answer
1k views

Short delayed (asynch) related record updates

I feel like there should be a straightforward answer here, but I'm coming up short... Trigger event: Account lookup field on Lead(s)/Contact(s) are updated OR a particular Account field is updated ...
Mike's user avatar
  • 1,179
2 votes
1 answer
690 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" /> ......
Robert Sösemann's user avatar
2 votes
2 answers
1k views

WebService returned a SOAP Fault: INVALID_SESSION_ID: This session is not valid for use with the API (async job)

I've take a look at a bunch of similar questions on stackexcahnge, but they weren't helpful. Here is the short explanation of the problem: We have a managed package with MetadataService class On one ...
Mariia Illarionova's user avatar
2 votes
1 answer
436 views

LWC enforce and validate an API method before calling another method

I'm looking to enforce a validation of sort to be implemented in LWC that consumes an external API. The validation call is suppose to check user access (an APEX based external API validation). Then ...
VarunC's user avatar
  • 5,900
2 votes
1 answer
107 views

Need advise on callouts and inserting/updating new records from external system

We have an external application where few records gets updated or created on daily basis. We already implemented inbound calls to salesforce but it is scheduled for once a month. We need to schedule a ...
AshSFcloud's user avatar
2 votes
1 answer
3k views

Get the actual Previous Fire Time of a CronTrigger / Scheduled Apex

I am exeuting Scheduled Apex that should do processing based on the last execution time of the particular code. I query some records for processing and I only want to query those records, that have ...
J. Schreiber's user avatar
  • 1,520
2 votes
1 answer
1k views

Waiting for results from APEX call in a for loop

I need to load a number of records more than the 2000 default limit for an SOQL query, but I need to wait until all of them are loaded before moving on. To do this, I make a request to get the total ...
BlondeSwan's user avatar
  • 1,078
2 votes
1 answer
632 views

Async Apex & Fault Tolerance

Trying to see if I can make Async Apex jobs fault tolerant; meaning if they fail can I implement some sort of retry logic? What would this retry mechanism look like and is there any documentation or ...
Venkat's user avatar
  • 45
2 votes
2 answers
1k views

Button redirects page before async call is finished in another field

I am really confused as to how to solve this issue I have on a visualforce page. Basically I have a pageblock table with some Opportunity Products displayed. On the onchange event of the fields in the ...
Mauricio's user avatar
2 votes
0 answers
71 views

Apex Engine old Version of apex code changed?

Recently (since January) we have encountered some cases when deploying new versions of our managed package. We have had at least 2 separate instances where changing a batch or an apex class referenced ...
Jose's user avatar
  • 2,102
2 votes
0 answers
338 views

Why does an Apex Action ConnectApi call from Flow work synchronously but fail asynchronously for Platform Integration User

Background We have a dev sandbox that is connected to and receives orders from a SFCC storefront, thus creating an Order record in the SF org. There is an OOTB Create Order Summary Flow that is ...
Moonpie's user avatar
  • 2,505
2 votes
1 answer
814 views

How to know when the last batch job in parallel execution finishes?

I have an apex class that is executed in parallel by calling Database.executeBatch() in a loop, where each instance processes a chunk of a dataset. After all the jobs that were executed finish I need ...
TemporaryFix's user avatar
  • 2,887
2 votes
0 answers
2k views

How to Launch Asynchronous Record Triggered Flow each time a Date Field is updated

I have a date field. I want to update the record every time this field is updated. Inside of the Record Triggered Flow I have an ISCHANGED condition and am seeing the following error when I try to ...
Matthew Metros's user avatar
2 votes
0 answers
350 views

Report Rest API (asynchronous run and excel export)

I'm trying to use Report Rest API to filter and export some of my reports. My first approach with synchronous report runs works pretty well, but I bumped into 500 batches' run per hour limitation. I ...
azimut3's user avatar
  • 120
2 votes
0 answers
39 views

Why use Change Event triggers over existing async methods? [duplicate]

When and why should we use Change Event Triggers over @future or queueable methods? Also do they use sync or asynch limits? I cannot find any clear documentation stating this.
Girbot's user avatar
  • 5,405
2 votes
2 answers
557 views

About using Test.startTest() / Test.stopTest() for batch execution testing purposes

just right now, while deploying some code from Sandbox environment to the Production one, I was noticing something strange within a test class that should have the aim to test a Batch class. I notice ...
user avatar
2 votes
2 answers
4k views

How to synchronize asynchronous Apex

There are different ways to offload long-running processes to asynchronous apex: we got future calls, scheduled Apex, batch Apex and, more recently, Queueable Apex. They are all good to launch "fire ...
mkorman's user avatar
  • 4,026
1 vote
4 answers
526 views

Avoid making 2 callouts for the same record

After a record is updated, i need to perform a callout to an external system, in order to synchronize the data. For that purpose, i have created a record-triggered flow for my custom object that: ...
Giorgos Galaios's user avatar
1 vote
2 answers
451 views

Dynamic SOQL Error: Unexpected Token ':' - I have searched for two days, what could I be missing?

I have a batch class that will be performing some actions over selected Case records. The only problem with this batch class is the Start method. When the query is returned and processed, it returns ...
Emmanuel_M's user avatar
1 vote
2 answers
7k views

How to use Promises / synchronize two asynchronous methods in Lightning Web Component(LWC)?

In LWC JS, I am making an external API call-out and an Apex method and accumulating the results. How to synchronizes the process? Example: renderedCallback(){ let a,b; getApiResult().then(...
Daniel Deepak's user avatar
1 vote
1 answer
871 views

Why isn't my platform event chain working?

I've create the following method: //@NotForProduction public class TEST_SandboxDataFactory { public static void create() { List<String> sObjectTypeNameList = new List<String>()...
Brian Kessler's user avatar
1 vote
1 answer
2k views

What is the life-cycle of static properties in Apex classes?

Sometimes when developing Apex, I've populated some static property. But then later -- most often in an Async or Test context -- I go to access it again and discover SFDC is behaving like it is ...
Brian Kessler's user avatar
1 vote
3 answers
2k views

Getting the job id of a chained job from the id of the parent job

I have a Queueable job that will initiate a Batch job. I have a transaction that enqueues the Queueable job and returns the id of the Queueable job. However, I need to be able to get the id of the ...
Jorjani's user avatar
  • 2,192
1 vote
1 answer
2k views

How is calculated "24-hour period" for the limitation of Asynchronous Apex Executions

I have a question regarding Execution Governors and Limits for daily maximum number of asynchronous Apex method executions. In the Salesforce documantation it is written, that the maximum number of ...
R.Paunova's user avatar
1 vote
3 answers
38k views

await does not wait for Promise to finish

In my LWC, I am trying to call an Apex method and wait for it to finish. This is what it comes down to: import apexMethodA from '@salesforce/apex/SomeControllerClass.apexMethodA'; export default ...
Sander de Jong's user avatar
1 vote
1 answer
1k views

Testing a Future Method that Schedules a Class - Test.stopTest() Does NOT Run Both Synchronously

I have a class with an @future callout method, and that future method schedules an instance of another class which also makes a callout. In effect, if the first callout is successful, it schedules ...
number41's user avatar
  • 928
1 vote
3 answers
2k views

Future method in trigger causes batch failures

I've recently been asked to convert a method in our account trigger to a future method to help reduce CPU errors during execution. When attempting to run all test classes in my org (for a completely ...
gNerb's user avatar
  • 9,431
1 vote
4 answers
4k views

Child Lightning Component needs parent init to work. Doable without dynamic components?

When I load this Lightning component a child component's init gets a null pointer as an attribute doesn't yet exist. I is populated via an Apex action during the parent components init. I know that a ...
Robert Sösemann's user avatar
1 vote
1 answer
1k views

LWC Async Function Returning Early

This may be an obvious question. It seems like it should be, but I haven't used async/await before. I have the below code removeProduct(event) { let removeProduct = this.checkRemoveProduct(); ...
SFD's user avatar
  • 25
1 vote
1 answer
848 views

Asynchronous Apex and Queue

I would like to confirm the following points with regard to Asynchronous Apex and particularly to these 3 in particular - Future Methods, Batch Apex and Queueable Apex. When an async request is made, ...
user73893's user avatar
  • 305
1 vote
1 answer
486 views

Method does not exist during async connectedCallback call

I have a datatable with several rows, each row representing a unique record. I want to build a url containing the id of the record for each row, but I want to surface a label in UI, not that url. { ...
Daft's user avatar
  • 2,661
1 vote
1 answer
425 views

Execute Javascript on VFP from Controller Query Results [closed]

I have a Visualforce Page with inputs, these input values are passed to a controller, query results are returned, and results are displayed in a datatable on the same VFP with inputs. If the list I ...
S.B.'s user avatar
  • 2,039

1 2
3
4 5
7