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.
51
questions with no upvoted or accepted answers
10
votes
0
answers
823
views
Implement Domain Event Pattern in Apex - can and should it be done?
In Domain Driven Design a single pattern is drawing a lot of attention to itself - Domain Events and Event Queues.
(slide via http://de.slideshare.net/andysal/never-mind-the-bollocks-heres-the-domain-...
4
votes
1
answer
282
views
CDC processes all 9999 requests at once. Is this by design or a bug?
In salesforce documentation batch size of platform event is mentioned as 2000 maximum (documentation). Which it definitely follows (tested). But for CDC its not mentioned. I also tried this in my dev ...
4
votes
0
answers
265
views
Can a Change Event Trigger include the same record multiple times?
I'm starting to play with Change Event Triggers, building a handler framework and I'm not sure if I need to handle a scenario where the same record would be included in the same Change Event trigger ...
3
votes
0
answers
2k
views
How to Target Element In Modal After Opening Modal
I have a custom modal component (with slots) that can be opened and closed. In a parent component I'm using this modal component and inside the body slot of the modal I have a <lightning-input> -...
3
votes
0
answers
358
views
Why does this Batch always and only abort in Production?
I have a long running asynchronous process that process millons of records in a CustomObject__c. To prevent other limits we have split this into 2 Batch classes that work on this table in parallel. So ...
2
votes
0
answers
83
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 ...
2
votes
0
answers
429
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 ...
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 ...
2
votes
0
answers
399
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 ...
1
vote
1
answer
224
views
Async/await is not working in LWC components on Firefox
We tried to use it in our LWC async/await but it is not working only on Firefox.
Here is a simple example. On the Firefox this alert doesn't show.
async init() {
let promise = new Promise((resolve,...
1
vote
1
answer
744
views
Async call on aura:method?
I got an aura:method inside my child component that returns an async response
<!-- inside child component -->
<aura:method name="saveMethod" action="{!c.saveChanges}" ...
1
vote
0
answers
538
views
Governor Limits: Scheduled Flows vs Async Apex
tl;dr - Do schedule flows (flow builder, not process builder) count against the same limit of scheduleable jobs that asynch apex (Queueable, Scheduleable, Batch) is limited by? If not, in what way to ...
1
vote
0
answers
292
views
Does each chunking of a batch goes through the same process of Queued, Processing and Completed states?
As per documentation :
The maximum number of asynchronous Apex method executions (batch Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour period
For Batch Apex, method ...
1
vote
1
answer
564
views
Populating a combobox with Salesforce data
I want to create a component with one input box with type="date" and a combobox that gets populated with options after a date is selected in the first input box component. I want this to ...
1
vote
0
answers
228
views
Calling Salesforce Rest Webservice url from vf controller
Hi I am trying to make a rest callout from controller and I am not been able to get response . I am using apex continution callout pattern for this to make call async.
This is controller class
...
1
vote
0
answers
71
views
Custom component taking long time to load
I'm having a record page with an heavy custom components.
By heavy I means like 20 seconds of loading time.
I'm trying to find a way to load it asyncronously without blocking the UI of the User.
...
1
vote
1
answer
212
views
Initialize jQuery plugins with ui:outputRichText in Lightning component
I have a Lightning component that displays record's content as rich text. The content contains HTML code and I need to make it work with jQuery on click handler and some plugins.
The content comes ...
1
vote
0
answers
1k
views
Apex Continuation - Response Method
I am using Apex Continuation to make a callout from a VF page, but the response method is not being executed and, as a result, no response is displayed on the page. Can anyone please see why this is ...
1
vote
1
answer
210
views
Fuel Java SDK - Asynchronous Triggered Sends
Are asynchronous triggered send calls possible using Fuel Java SDK v1.0.3?
0
votes
0
answers
28
views
Best practice to deal with HATEOAS api callouts
I'm creating an connector between Salesforce and a ticketing system that exposes a REST API based on HATEOAS. I need to synchronize tickets everyday and insert/update them as Cases. Salesforce is ...
0
votes
1
answer
32
views
lightning-spinner does not show up when a js function is working
Here is my code
// Need to use the result from Promise but it is coming false
const validateCompleted = await this.validateData(data);
if(validateCompleted){
...
}
// When validating data, I want ...
0
votes
1
answer
55
views
Issue using multiple ISNULL entry conditions for a record-triggered flow
I am running into issues when setting up an asynchronous flow to trigger based on multiple ISNULL conditions.
For context, there are two separate account look up fields. When one of these fields is ...
0
votes
0
answers
147
views
Asynchronously flow doesn't run
Hello,
I am working on a flow when an user is deactivated, I have to update some accounts depending criterias.
Because I update related records and because I update accounts after an user, I use a ...
0
votes
1
answer
156
views
Fix Record Lock issue or Record Not available
I have a trigger on an Object called SubscriptionProductCharges.
we have another system that are updating SubscriptionProductCharges records in a batch of 1, which means if we update 5 records, then ...
0
votes
0
answers
79
views
Failing Salesforce Queue
I am rearchitecting some apex code that I have been handed. I updated an @future method to use the Queueable interface, because as it turns out the method was being called as part of trigger that was ...
0
votes
0
answers
570
views
Having issues with the flows whenever they run in Asynchronous mode
While working on establishing a record trigger flow, my objective was to synchronize and manage specific fields related to Skills and Certifications between the PSA system and the Skill object in the ...
0
votes
0
answers
54
views
Capture few Case fields changes and send to third party
We want to track around 20-30 fields changes of case object. These fields changes can include the long text area field, multiselect picklist values, formula fields, and roll summary also. The reason I ...
0
votes
0
answers
686
views
Can I run an asychronous flow after insert?
To create a flow that runs asynchronously I have to add a condition with ISCHANGED or configure it to run only when a record is updated to meet the condition requirements.
The ISCHANGED function does ...
0
votes
0
answers
99
views
Idiomatic way to call external APIs from Salesforce
I'm new to Salesforce, and am looking for advice on how to best approach a scenario where a Salesforce runtime communicates with an external REST-service that is under my control. My background is web-...
0
votes
0
answers
240
views
System.AsyncException: Database.executeBatch: batch apex job enqueue failed
I have a batch class which updates a set of records with data from an external system. About twice a month or so, this exception is thrown: errorCode":"APEX_ERROR","message":&...
0
votes
0
answers
355
views
What can be the reason why unit tests pass in the Sandbox environment but fail during deployment to the same Sandbox?
We have a Sandbox_1 where all unit tests are running properly, and we want to deploy our code to an entirely different organization via our repository
When running unit tests we have issues with ...
0
votes
1
answer
505
views
Can multiple async methods updating same record can create row lock issue
Does multiple asynchronous process like Queueable, future etc running concurrently that are updating same record create row lock issues.
We are facing row lock issues in async transactions that ...
0
votes
0
answers
126
views
Retrieve the index of item in list before insertion within Stateful Batch Apex Class
I have a batch class that implements the following headers Database.Batchable<Map<String, Object>>, Database.Stateful . Within the DocumentParser class, I am creating a Map Object that is ...
0
votes
1
answer
1k
views
Expand all rows of LWC tree-grid with asynchronous loading
I'm having trouble figuring out how to create a button to expand all rows with my current setup. The child rows are only loaded when the parent is toggled. Is there a way to retrieve them all at once ...
0
votes
0
answers
822
views
Batch class finish method not executing on REQUEST_RUNNING_TOO_LONG error
I intended to send an email to the users when the batch class fails due to any reason. I had placed my logic in the finish method. However, my batch class is failing for the reason :
[...
0
votes
0
answers
465
views
Insufficient Privilege on id:[] accountcontactrelation create record failed
Context
Account read privilege is at user level
Sharing rule allows Users to see other User's Account records, Read privilege only.
An LWc on a Visualforce Page allows a user to perform some business ...
0
votes
0
answers
2k
views
Asynchronous Flow only working on create in Debug mode
I have been working on a roll up flow to sum up a field on a custom object and then update a field on the parent object with that total. However I have used the asynchronous path and while it works ...
0
votes
0
answers
700
views
Was trying to get the Data from the API Endpoints and Insert into Salesforce Org
I am new to the Salesforce Developer and was trying to do something where I was trying to fetch the data from the API endpoints and Insert into my Object of salesforce Org.
Using the Future ...
0
votes
1
answer
592
views
How to achieve Asynchronous Apex with Aura Components? (NOT Callouts)
I have a working Aura Application with a requirement of showing heavy data inside of many lightning datatables based on the LoggedInUser.
It works fine for majority of the users but for few, the data ...
0
votes
0
answers
139
views
Executing a callout at the end of a chain of methods operating in @future context
I have a callout method that is executed as the last step of a long chain of methods when a record's status get changed to "completed". Early in this sequence, we have a method that we have ...
0
votes
1
answer
99
views
Do workflow outbound messages (OBM) and @future methods share a single message queue for asynchronous processing?
Do workflow outbound messages (OBM) and @future methods both share a single message queue for asynchronous processing?
0
votes
0
answers
493
views
How can I access a High Assurance Session in an Async Apex context?
Has anyone worked with a high assurance session requirement and async apex?
I need to query the Security Health Check objects during an async process (the query happens in a queueable). If "View ...
0
votes
0
answers
150
views
Adding remoteSite settings dynamically from postInstallScript
I checked this link to add remoteSiteSettings dynamically. Above link suggesting to add visualforce base url to remote site setting first. I am able to insert that without any issues from synchronous ...
0
votes
0
answers
347
views
AsyncSaveCallback not working in apex
I am trying to insert records to an external object and get the Id back for the inserted record
I have the following piece of code
Database.SaveResult[] insertResultAccount = Database.insertAsync(...
0
votes
0
answers
2k
views
Why is SerialBatchApexRangeChunkHandler more than the number of batches?
I am working on batch apex and I have just tried writing a simple code for learning purpose. In the start method I am querying the records limiting them to 7, and I am running the batch job from the ...
0
votes
0
answers
466
views
Finding out when lightning-record-form has finished rendering?
I have a LWC which displays the Compact Layout as a popup in a graph using lightning-record-form. The LWC holds a <slot> in which the popup-lwc has the record for like so.
<template>
&...
0
votes
0
answers
2k
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 ...
0
votes
0
answers
211
views
Callback on completion of AsyncApexJob
Is there a way to have Apex code execute when an asynchronous job finishes? I want to solve this problem without polling (which seems to be the dominant solution).
0
votes
0
answers
409
views
Running Tests in Production WHILE Deploying to Production - Row Lock Error
In our test classes, we utilize testSetup methods that create and insert records in preparation for their use in the test methods of the class.
I found today that if I'm running tests in Production ...
-2
votes
1
answer
386
views
Which is a better approach when updating records using batch class, to place it in execute or finish method?
Sorry but I am new to this and I just wander, do you think it is better to put all the millions of records inside the Map object which is process by the execute method, however the dml where the ...