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
0 votes
0 answers
42 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,...
hsd's user avatar
  • 113
0 votes
0 answers
34 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 ...
Luke Sharon's user avatar
-1 votes
1 answer
35 views

LWC - How to populate component when the page just load

I'm using Custom Setting to remember what user set for that specific setting. So when the component load, it will fetch values from Custom Setting. (1)If there is no value => Column will generate ...
Pam's user avatar
  • 97
0 votes
1 answer
38 views

LWC - Cannot fetch Currency field type to display in lightning-combobox

I'm trying to get all currency field type of a specific object and display it in lightning-combobox but it does not work. When I execute this method with anonymous window, I got the result I want. But ...
Pam's user avatar
  • 97
0 votes
2 answers
68 views

LWC - Async/Await but value hasn't returned

I have 2 picklists. When the first picklist get clicked, it will captured the value and pass to the second picklist. Right now, I'm using async/await and also try to call it imperative but it did not ...
Pam's user avatar
  • 97
0 votes
0 answers
74 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 ...
Sai Praveen's user avatar
0 votes
0 answers
14 views

When will Aysnc method or Class will execute? [duplicate]

We have a case object subject field. When the case is created, Trigger fires and update the subject, then flows fire to update subject again..Now i have a future method or Queueable class or batch ...
Raja Ray's user avatar
  • 107
0 votes
0 answers
27 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 ...
Rabb's user avatar
  • 345
0 votes
1 answer
57 views

What is meant by resources being available in context of a future method?

Future methods execute when the resources are available. How does a future method know that the resources are available and is there any time limit after which the future method halts if the resources ...
Paritosh's user avatar
0 votes
0 answers
129 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 ...
Emmanuel BRUNO's user avatar
0 votes
0 answers
40 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-...
Arne's user avatar
  • 101
0 votes
0 answers
142 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":&...
Gabriel Gonzalez's user avatar
0 votes
1 answer
50 views

Empty values when trying to run part of Flow Synchronously and part of it Asynchronously

I have a Flow that runs when an Opportunity is created or updated. The Flow is supposed to update some values on the ProductLineItems that are associated with the Opportunity. Part of the Flow runs ...
charlottesville's user avatar
-1 votes
1 answer
129 views

Pass Http Get and Http Post as asynchronous apex in order [closed]

My requirement is to pass data from my org (Salesforce) to external org (SAP S4). I have successfully made the class for integrating both. However, I need to pass this class in a trigger and since it ...
Capt Shaunz's user avatar
0 votes
1 answer
326 views

LWC async/await execution is stepping to next line before resolving promise

From the below code, I'm trying to get the userId for each user in the list and add it to userRec array, using await for the promise to be resolved before going to next step. I expect the logs to be ...
Praveen's user avatar
2 votes
0 answers
62 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,092
4 votes
2 answers
529 views

How to avoid running a batchable when an instance is already running?

We have several batchables that if run in parallel trample over each other's results. So I want to block a second invocation if there is already one running and just tell the user to wait. My first ...
Keith C's user avatar
  • 134k
4 votes
1 answer
178 views

How do we resolve LWC timing issues with less trial-and-error?

It seems like a more comprehensive discussion of LWC async programming would be helpful. Luckily most stuff works if you follow the LWC examples, but once your design falls outside the examples, ...
Ron Van Aken's user avatar
2 votes
0 answers
291 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
0 votes
0 answers
73 views

How asynchronous Flow get field values?

I am using an asynchronous flow to send an approval using some conditions. I want to know, suppose my flow runs after 4 minutes when it's synchronized, the values of opportunity record are used in ...
user126625's user avatar
-2 votes
1 answer
114 views

Batch Apex Class to update lookup field

I really need help with my code. I am trying to update Account records with lookup field to right Pricebook2 based on Customer_Price_Group__c field on Account and Pricebook2. Customer_Price_Group__c ...
Dev098's user avatar
  • 1
1 vote
1 answer
475 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}" ...
erikvm's user avatar
  • 721
0 votes
1 answer
436 views

Async/Await or Request/Response LWC Messaging

I have several LWC components that share data with each other. I am sending messages across just fine between the sibling components and sharing data based on events and user actions. However, I have ...
Shanerk's user avatar
  • 1,042
0 votes
0 answers
266 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 ...
LucyFenel's user avatar
2 votes
1 answer
558 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
0 votes
1 answer
390 views

Chaining Queueable Apex with Callouts Run Into Loop

I have a queueable class that is triggered from a trigger that makes a callout. I wanted to use Queueable for scenarios where I need to insert 3-5k of records and eventually make 3-5k callouts. But ...
jhin's user avatar
  • 23
2 votes
1 answer
812 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
4 votes
1 answer
236 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 ...
Nagendra Singh's user avatar
0 votes
2 answers
1k views

Faster way for deleting millions of records

We have to delete nearly a million record on a daily basis. We currently have a batch which is scheduled and it deletes all the records. The batch is taking too much of time to delete these records. ...
threeone97's user avatar
0 votes
1 answer
281 views

UpdateAsync(sobject) Method to update records in a (spawn) new transaction

The documentation says that data on the external system. Asynchronous operation is used to process\update these records Query Does this mean I can update Sobjects (custom and\or standard) using this ...
IHaveAQuestion's user avatar
1 vote
1 answer
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
0 votes
1 answer
373 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 ...
sfdeveloper's user avatar
1 vote
1 answer
900 views

AsyncApexJob returning two records for one executed instance of batch

When I am executing one batch then that batch runs only once. I have verified it from the 'Apex Jobs' from Setup. But when I am querying the AsyncApexJob for that batch class, it is returning two ...
Muskan Agarwal'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
0 votes
0 answers
629 views

Time-based Workflow Schedule Date keeps getting pushed forward 5 minutes

I created a record triggered after update flow that tests if a field has changed in the entry criteria, allowing me to create an async path: When a record is updated, the immediate path executes, ...
Swisher Sweet's user avatar
-2 votes
1 answer
788 views

Is there a way I can run an asynchronous batch class synchronously? [closed]

I know, it should not be done. But theoretically is it possible?
Gargi Gupta's user avatar
0 votes
0 answers
114 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 ...
Matthew Metros's user avatar
1 vote
0 answers
407 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 ...
Jwok's user avatar
  • 757
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 ...
Luke Higgins's user avatar
0 votes
1 answer
739 views

Batch Apex: class executed multiple times at once?

I have a batch apex class, and this class makes a SELECT with a limit of 1000. after that, this class creates one campaign using insert, and processes others things, whatever. the question is when I ...
Arthur Almeida's user avatar
0 votes
1 answer
486 views

INVALID_ACCESS_LEVEL you don't have access to the Orchestration Run object

I have a flow that cancels an Orchestration, it works when run as an administrative user. When I run as a non administrative user, it produces the following error even when the flow is set in system ...
Gabriel M's user avatar
  • 106
1 vote
1 answer
412 views

Is it possible to create user and assign permission set in same flow?

I am trying to create users and trying to assign permission sets to them using flow. Since we get MIXED DML error when we try to do both of these tasks in a single transaction, I tried to use the ...
Ashik Shetty's user avatar
0 votes
2 answers
270 views

Best practice for async apex classes (Queueable, Batchable) in relation to service classes

When creating async apex classes (e.g. Batcheable, Queueable), especially classes associated with specific SObjects, what might be the best practice for where these async classes should be housed. ...
Jwok's user avatar
  • 757
1 vote
1 answer
1k views

Metadata cannot be deployed from within a test [duplicate]

When trying to insert a custom metadata record within the test it gives me the following error @IsTest public class Object_1TriggerTest { @IsTest public static void Load_field_1_from_metadata()...
Ernesto Truyen's user avatar
0 votes
2 answers
1k views

Test coverage for finish method in Batch Apex with a chain class

I wrote a test class for a Batch Apex Class that has a chain of another class in the Finish method. I tried the following approach, but it still does not cover the lines in the Finish method. Is there ...
Argen Turatbek's user avatar
1 vote
0 answers
198 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 ...
Nagendra Singh's user avatar
3 votes
3 answers
1k views

Promises in Apex?

We have a very complex scenario where we have multiple external systems that we interact with and we need to make sure the data is valid across multiple external systems before it gets processed ...
jojopogi's user avatar
  • 484
0 votes
1 answer
126 views

I am getting FATAL_ERROR System.QueryException: unexpected token: BM_DPM_Date__c

I am facing the following issue. I wrote this query for the start method of my batch class. global Date startDate; global Date endDate; global Date currentDate; global Database.QueryLocator start(...
Argen Turatbek's user avatar
2 votes
2 answers
1k 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
2 answers
287 views

Mutation of Finalizer state

Below is the statement from documentation: The Finalizer framework uses the state of the Finalizer object, if one is attached, at the end of Queueable execution. Mutation of the Finalizer state, ...
Rajendra Singh Nagar's user avatar

1
2 3 4 5
7