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
15 views

Record triggered asynchronous flow vs Maximum number of methods with the future annotation

I have a scenario related to a potential issue we are facing in an org. An autolaunched flow executes once and loops 51 times through a create record element which creates 1 single record in each ...
user avatar
  • 1
0 votes
1 answer
21 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()...
user avatar
0 votes
1 answer
37 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 ...
user avatar
  • 17
1 vote
0 answers
39 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 ...
user avatar
2 votes
3 answers
241 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 ...
user avatar
  • 362
0 votes
0 answers
8 views

How to test asynchronous flow? [duplicate]

I have an asynchronous flow that updates a parent record when a child is created. It's async because I reference a roll up sum field on the parent in the flow. This works fine. I'm writing an apex ...
user avatar
  • 616
0 votes
1 answer
17 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(...
user avatar
  • 17
-2 votes
1 answer
36 views

For the Apex jobs that failed to execute, what is/should be the next action we need to take in order to determine the job run time?

For the Apex jobs that failed to execute, what is/should be the next action we need to take in order to determine the job run time?
user avatar
2 votes
2 answers
171 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 ...
user avatar
1 vote
2 answers
64 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, ...
user avatar
0 votes
0 answers
73 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 : [...
user avatar
0 votes
1 answer
32 views

How do I use batch apex if my method is creating over 40000 records

It's just a simple question I'm having(It might sound silly but I've no idea how do I insert 40000 records). I'm first creating 200 Accounts and also creating 200 child Opportunities for each Account. ...
user avatar
0 votes
0 answers
58 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 ...
user avatar
2 votes
1 answer
83 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 ...
user avatar
  • 2,584
3 votes
1 answer
49 views

Best architecture solution for Mixed DML Exceptions inside a Batch

I am writing an apex Batch First I am updating a few EmailTemapltes and then I need to write to a custom object. public void execute(Database.BatchableContext context, List<EmailTemplate> scope) ...
user avatar
  • 31
0 votes
0 answers
171 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 ...
user avatar
  • 1
3 votes
0 answers
47 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> -...
user avatar
  • 451
-2 votes
1 answer
59 views

AsyncApex Scenarios [closed]

I am writing a few Ques for which i have found conflicting answers on Internet. Also I have written my Answers after researching on Internet, but wasnt 100% sure, hence posting these here to clear ...
user avatar
  • 750
3 votes
2 answers
267 views

Why would a future method not show up in debug logs?

What are some possible reasons a future method wouldn't show up in the debug logs? @Future(Callout=true) global static void myFutureCallout(Id testId){...
user avatar
  • 3,167
0 votes
0 answers
368 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 ...
user avatar
0 votes
0 answers
50 views

Leaflet map loaded multiple time - Async function

I am using a leaflet map in a LWC. For some reason that I am not understanding yet my map is initialised multiple time (3 times to be exact) and then I am getting errors such as I am doing something ...
user avatar
  • 281
1 vote
4 answers
190 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: ...
user avatar
0 votes
1 answer
114 views

Question for confirmation: Callout from Trigger using Platform Events

After a record is updated in Salesforce, i need to perform a callout to synchronize data to an External System. Ideally, i would like to do this kind of synchronously, however it doesn't seem to be ...
user avatar
0 votes
0 answers
62 views

Phantom Runaway Queuable Job "Limit Check"

I have some very strange sandbox behavior - there is a runaway queuable job that appears to be doing absolutely nothing in the system, last only .006 seconds, and completely locks up the system as it ...
user avatar
  • 626
5 votes
2 answers
469 views

DML Error on new Asynchronous Record-Triggered Flow

We've recently developed a record triggered flow that retrieves data via callout when a certain field is set, using Salesforce's new Asynchronous Record-Triggered Flow. The issue we're having is, that ...
user avatar
0 votes
0 answers
60 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 ...
user avatar
0 votes
1 answer
53 views

Why Queueable came into the picture [duplicate]

Why Queueable came into the picture when we already had Batch Apex available to Us. I know Queueable is better than future in context of accepting non-primitive data types and for job monitoring and ...
user avatar
  • 2,637
0 votes
1 answer
30 views

Can't create a Contact John Doe to related Account passing ID, any suggestions?

global with sharing class JohnDoeBatch implements Database.Batchable<SObject> { //Start method global Database.QueryLocator start(Database.BatchableContext bc) { String query = '...
user avatar
1 vote
0 answers
51 views

Modern polling solutions [closed]

Among the several ways we have in salesforce to do polling to 3rd parties using callouts, I see important drawbacks for each of those that make taking a decision difficult. Background solutions are ...
user avatar
0 votes
0 answers
29 views

Batch Job causing an error in FSC [duplicate]

I wrote a visualforce page that launches a batch job that processes records in batches, the batch creates households, person accounts, and then financial accounts for Salesforce Financial Service ...
user avatar
  • 13
1 vote
1 answer
191 views

Why does Future and Queueable or any Async rollback or does not get called when an exception is occurred in Main Thread?

I was trying to test if Async opens up a new thread or is tied to the main thread and the result was very interesting. Consider this class: public with sharing class TestClassTest { public static ...
user avatar
0 votes
1 answer
358 views

In Asynchronous using Rest Api Error: System.LimitException: Apex heap size too large: 19312398

I got the error as heap size limit too large, I'm able to send below 2MB file by using Asynchronous method but the limits is 12MB and trying to send 12MB file to external system by using Rest Api. ...
user avatar
4 votes
1 answer
86 views

How bad an idea is it to make a server side "save" call in disconnectedCallback?

This LWC lifecycle method is documented as: Use disconnectedCallback() to clean up work done in the connectedCallback(), like purging caches or removing event listeners. Not that the set of ...
user avatar
  • 129k
1 vote
1 answer
58 views

How to process a bulk of records manually

I have a visualforce page where users upload a csv file to create person accounts. This worked fine in a small sample size, but when I try a bigger file I got a timeout issue. So I split up the code ...
user avatar
  • 13
0 votes
1 answer
345 views

Where does Queueable job gets Queued?

I wrote this class: public with sharing class QueueTest1 implements Queueable, Finalizer{ public QueueTest1(){ } public void execute(FinalizerContext param1) { System.debug('...
user avatar
2 votes
1 answer
145 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 ...
user avatar
  • 5,596
14 votes
1 answer
621 views

How to archive & restore Custom Objects in Big Objects

For my app I want to build a Archive and Restore functionality. For a given Custom Object MyObject__c and a Big Object ArchivedMyObject__b those requirements need to be fulfilled: MyObject__c records ...
user avatar
0 votes
1 answer
58 views

How Can A Batch Transaction Be Executed From A Nested Loop To Update Variables In The Outer Loop?

How can we update a variable in an outer loop from a Batch transaction in an inner loop? For example, consider a example scenario where you must track the even Apples (per Basket) inside multiple ...
user avatar
0 votes
1 answer
54 views

Why do developers set 'this' to a variable (e.g. 'self' or 'that')?

When I inherit another developers code base I will often see something declaration like the following: I have seen this most frequently used in LWCs. But I'm not sure what the purpose is and given the ...
user avatar
  • 1,228
0 votes
1 answer
183 views

Can @future be called in constructor of a class

Trailhead Link - https://trailhead.salesforce.com/content/learn/modules/asynchronous_apex/async_apex_future_methods#:~:text=Future%20methods%20won't%20necessarily,same%20order%20they%20are%20called.&...
user avatar
-1 votes
1 answer
54 views

How to limit the asynchronous job running in salesforce [duplicate]

I am using Queueuable Interface in trigger like this, System.enqueueJob(new testobjectmethod(trigger.new,trigger.oldMap)) My Queueuable class: public class testobjectmethod implements Queueable,...
user avatar
1 vote
1 answer
114 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 ...
user avatar
0 votes
1 answer
378 views

How to add delay to the spinner till the Queable job gets completed [closed]

we have a lightning button on community. when we click on it a queable class gets triggered and it will update forms status. whenever I am clicking on the button it is taking some time to update the ...
user avatar
0 votes
1 answer
109 views

Choose async or sync based on amount of data returned or trigger size?

Can anybody guide me through any framework which I can refer in order to achieve this use case?I am not able to get my head around it on how to do it efficiently. I want to process records in near ...
user avatar
  • 125
1 vote
1 answer
48 views

Is there a way to get the ids of the inserted records when using Metadata.Operations.enqueueDeployment

I was going through the documentation and I saw this example public void updateAndDeployMetadata() { // Setup custom metadata to be created in the subscriber org. Metadata.CustomMetadata ...
user avatar
  • 4,441
1 vote
2 answers
201 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 ...
user avatar
0 votes
1 answer
39 views

pass parameters to then chain in promise

I'm using JSforce to retrieve an Account Id, once the operation is completed, I need to pass the retrieved account's Id and another Map to another function. testAsync(); function testAsync() { ...
user avatar
  • 1,431
1 vote
1 answer
309 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, ...
user avatar
  • 205
5 votes
1 answer
1k views

LWC multiple apex calls on initialization (Best practices question)

PROBLEM: I have a LWC component which needs to gather data from different objects on initialization event (Objects are: custom object, files and metadata type). This is what I have in place working ...
user avatar
3 votes
1 answer
166 views

How to monitor not yet started jobs of a Queuable chain

I am wrapping my head around how to use Apex Queuable as a queue and not as a chain. As I understand all the code samples out there, the next job is enqueued after the work of the previous one is done....
user avatar

1
2 3 4 5 6