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
0answers
23 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 ...
0
votes
0answers
19 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
1answer
42 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 ...
0
votes
1answer
29 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 = '...
1
vote
0answers
34 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 ...
0
votes
0answers
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 ...
1
vote
1answer
34 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 ...
0
votes
1answer
44 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. ...
4
votes
1answer
54 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 ...
1
vote
1answer
39 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 ...
0
votes
1answer
79 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('...
2
votes
1answer
58 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 ...
13
votes
1answer
429 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 ...
0
votes
1answer
27 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 ...
0
votes
1answer
50 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 ...
0
votes
1answer
65 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.&...
-1
votes
1answer
51 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,...
1
vote
1answer
55 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 ...
0
votes
1answer
125 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 ...
0
votes
1answer
51 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 ...
1
vote
1answer
29 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 ...
1
vote
2answers
103 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 ...
0
votes
1answer
30 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() { ...
0
votes
1answer
129 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, ...
5
votes
1answer
442 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 ...
2
votes
1answer
122 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....
0
votes
1answer
100 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 ...
1
vote
2answers
40 views

Does NetworkMember solve the problem of assigning the Network Id in Communities/Experiences?

See: Why does adding a Queueable cause an INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY error? for some background. That results in the need to set the NetworkId (there is one of these per Community) ...
0
votes
0answers
62 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
1answer
35 views

Service console waits for aura component to finish init before rendering case

I have an aura component (as managed package) in service console. the component fetches case's fields (via soql), sends them to an external server, gets a response, and displays it. everything works ...
3
votes
1answer
246 views

Can Database.executeBatch be called from a Queueable started by System.enqueueJob?

I'm aware that you can't call Database.executeBatch from the execute method of an already running Batchable. But can Database.executeBatch be called from a Queueable running via System.enqueueJob? I'm ...
0
votes
1answer
190 views

calling apex method which does callout returns undefined in LWC while showing the correct result in apex debug logs

I have the following lwc code: import findLocalityApex from '@salesforce/apex/NACController.findLocalityApex' ... findLocality() { console.log('this.lat findLocality' + this.lat); ...
0
votes
1answer
31 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
1answer
43 views

Asynchronous trigger (Change Data Capture)

I have a asynchronous trigger on Sobject(Billing_Product__c) which works on CDC framework. Change event can be caused by insert, update or delete. How do I check inside trigger if the change event is ...
1
vote
3answers
7k 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 ...
11
votes
1answer
166 views

Why do we have higher apex async executions on days we deploy to Production?

We call the following endpoint at the same time each day to get a count of our daily async executions to track our usage. /services/data/v50.0/limits The following response gives us the # of daily ...
1
vote
2answers
516 views

Making Workflow (Process Builders/Flows/etc) run asynchronously?

We are running into performance issues/CPU timeouts due to all the Process Builders, Flows, and workflow rules we have on the Case object. In particular these errors occur when we bulk insert ...
1
vote
1answer
140 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. { ...
-2
votes
1answer
45 views

How to solve read time out error in Apex callout?

Hi all and thanks for reading Got this code: public class SendingZabbixServices{ @future(callout = true) public static void zabbixDoPostFuture(String jsonString, String endpoint){ ...
0
votes
1answer
116 views

CalloutException: you have uncommitted work pending - without DML? [duplicate]

I want to test a Queueable class that makes callouts to an external system. I'm baffled because I keep getting uncommitted work pending exception. My execute method queries custom metadata, constructs ...
1
vote
1answer
58 views

Working with large data volume

I have a design question and I want an expert opinion from the group. Here is the use case: Whenever there is any update on the Booking record (let's say change the status to "Cancelled"), ...
0
votes
0answers
11 views

Transient Error: PerformResult has OK status, but is missing a Result list

I am using the Perform endpoint to request starting ImportDefinition for an FTP CSV file. Some highlights: I use the CustomerKey of the Import Definition in the PerformRequest Definition tag. I am ...
0
votes
1answer
118 views

Apex Job Execution - Multiple @future Methods in the Same Transaction

Could you please help me with the below queries related to Apex Job Execution: If multiple Async request(future methods) are fired in the same thread, it makes the Async job request status as Queued ...
0
votes
1answer
49 views

Cannot retrieve the property value in JavaScript from Apex controller after making the call to the web service

I'm trying to retrieve the boolean value for the property from my controller. This value is being assigned after the call to the web service like this: public Static Boolean myVariable { get; set; } @...
0
votes
1answer
60 views

Is there is good way to send an email to a user after 5 minutes of inactivity on an Account?

An indeterminate number of images will be attached to Lead records. We have a requirement that 5 minutes after the last image is attached, the Lead owner should automatically receive an email. I've ...
0
votes
0answers
161 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 ...
3
votes
1answer
56 views

Is Lead.Name 100% predictable?

We have an integration with a third party site which requires an exact match for the Lead Name. When we have a new lead, we need to make a call out to this website. In Trigger.new, Lead.Name is always ...
0
votes
2answers
38 views

Design to run a batchable after a trigger and account for multiple workflows

Our current design starts from a trigger, checks the data against a bunch of rules that the customer sets up. The ones that pass get sent to another job which exports it to another external system ...
0
votes
1answer
199 views

Handling a combination of async callouts, schedulable jobs, and queueable jobs

The current requirements for my system is as follows: When a certain change is saved on the Account object, I need to create an Order object and make a callout to Service A. Service A finishes ...
0
votes
2answers
279 views

Making Callout from Apex triggers [duplicate]

I have a Apex Trigger which makes the callout to the External system when a field in a record is updated. The Apex Trigger and the Callout method are like below trigger updateLocation Account (after ...

1
2 3 4 5