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
1 answer
211 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 ...
John Doe's user avatar
0 votes
1 answer
988 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); ...
nSv23's user avatar
  • 544
0 votes
1 answer
443 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 ...
Brian Kessler's user avatar
0 votes
1 answer
37 views

How can I make sure that block of code in unit test will be runned after batch ends - not before or during test?

I need to run batch (or something else which will process big amount of records) and after this branch I need to invoke System.assert(booleanVariable); How can I do this? Batch need to execute and ...
NickName43's user avatar
0 votes
2 answers
434 views

System.isScheduled() not working in Scheduler/Batch

I have a Scheduler class which executes a batch class. I also execute this batch class from a VF page. Deep down in the class hierarchy, I want to check if this batch was called from a Scheduler or a ...
d_k's user avatar
  • 1,291
0 votes
2 answers
823 views

SOQL Query on PricebookEntry returning no rows

I'm trying to create a queueable apex class which will update the unit prices of all Products (on all Pricebooks) based on newly updated exchange rates. I'm able to successfully query on ...
Nick's user avatar
  • 11
0 votes
1 answer
347 views

Test.stopTest() does not run @futureJob called from an enqueuedJob

I have a future job that is called from an enqueued job. The code works fine when I run manual tests; however, when my test class, which looks like the code below doesn't finish the future job: Test....
Jorjani's user avatar
  • 2,192
0 votes
1 answer
105 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
0 votes
1 answer
464 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
0 votes
1 answer
183 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 ...
Noob_NoVoice's user avatar
  • 2,709
0 votes
1 answer
615 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.&...
Pankaj Kumar's user avatar
0 votes
1 answer
1k 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 ...
user96288's user avatar
0 votes
1 answer
2k 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() { ...
Json's user avatar
  • 1,587
0 votes
1 answer
1k 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 ...
Saurabh's user avatar
  • 27
0 votes
2 answers
2k 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 ...
user81642's user avatar
  • 667
0 votes
2 answers
341 views

Facing CPU time limit error

Weekly about 10,000 records are inserted and there is a Trigger that calls a class to process these records. All this process is synchronous, but for some cases it's taking too long to process and ...
A Louis's user avatar
0 votes
2 answers
838 views

Get ApexJobId from Future method

Is it possible to get the ApexJobId within the Future method apex code (or from the method its invoked from)? Use case - Our application is invoking multiple same future calls from within one apex ...
Sidharth Agarwal's user avatar
0 votes
1 answer
500 views

Issues in Scheduled Apex

Error:First error: Delete failed. First exception on row 0 with id a2A0R000003T2DMUA0; first error: ENTITY_IS_DELETED, entity is deleted: [] Note: Above error occurs to me as a concurrency Issue. ...
Hemavantha Rajesh Varma Mudunu's user avatar
0 votes
1 answer
37 views

External Application receiving multiple Success Pings

For the SFDC Integration I send out a call to an external application and receive a Success status in my debug log(I am logged in as myself). External application says they are getting multiple pings ...
nameishi's user avatar
0 votes
1 answer
1k views

What is the execution context for an asynchronous method?

Is it always system context, or it depends on where the method is called?
Renato Oliveira's user avatar
0 votes
1 answer
1k views

AsyncApexJob object doesn't contain history records

We have scheduled batch classes implemented and monitoring them at the Apex Jobs page in the setup. However it seems it's showing only very recent records and when try to retrieve from AsyncApexJob ...
highfive's user avatar
  • 6,231
0 votes
1 answer
666 views

Need help with Bulk API

I know that Bulk API is an asynchronous API. I understood Bulk API, going through the developer guide, but have a question unanswered. When a job completes or a batch completes, is there a ...
Nagesh Borate's user avatar
0 votes
1 answer
220 views

Trigger on S2S's successfull sharing

Use case: I need to update all related opps in our org if their parent account was successfully shared through S2S (Sharing status = "Active (sent)". The account record on our side's not updated when ...
EvAzi's user avatar
  • 1,041
0 votes
1 answer
101 views

Document upload parallel through Apex - Design review

I am doubtful whether I am going in the right direction. My requirement is to upload all the documents from Salesforce to my local storage space. I have a button that triggers the following function: ...
dmachop's user avatar
  • 1,089
0 votes
1 answer
877 views

ActionFuntion Rerender in VF page leads to sudden "Insufficient Privileges" - even as Admin

To make a VF component appear to load faster I used an actionFunction to load it only after the rest of the pages has loaded (jquery's document.ready). After doing this my component showed an "...
Robert Sösemann's user avatar
0 votes
2 answers
116 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
1 answer
65 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
1 answer
539 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
2 answers
2k 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
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
0 votes
1 answer
135 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
0 votes
1 answer
268 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. ...
whoisnilu's user avatar
  • 115
0 votes
1 answer
438 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 ...
Isha's user avatar
  • 163
0 votes
1 answer
351 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 ...
Jatin's user avatar
  • 5
0 votes
1 answer
139 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; } @...
heisenberg's user avatar
0 votes
2 answers
51 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 ...
J. Larson's user avatar
0 votes
1 answer
867 views

Want to create Record in batch class and there is no record to query in start method

I had one batch class in which i am passing some data required for creating object record.But when i call that batch class from parent class variables are initialized but start method are not called ...
Paresh Patil's user avatar
0 votes
1 answer
978 views

Platform Events - Fire platform event from event trigger?

We are planning to build some kind of a processing chain, when every item in an array is processed in separate scope of limits. Processing should happen strictly in a sequential way, i.e. second item ...
wesaw's user avatar
  • 2,990
0 votes
1 answer
214 views

Deleting Scheduled Job versus Aborting job?

What will happen if the scheduled job is deleted and what happen if it is aborted. Do we have any significant difference
Vineel's user avatar
  • 65
0 votes
1 answer
426 views

async internal calls from visualforce, any quick examples?

often async calls are used to callout, but what do async calls look like when an org asynchronously queuries itself, so what do “internal async calls” look like in general, and when done from ...
Peter Noges's user avatar
  • 1,100
0 votes
1 answer
363 views

Cache value not being saved in Org from Async call

I have a batch call that calls a queuaeble that calls a future call which utilizes a visualforce page 'getContentAsPdf' function. Also in this queuable call I set a custom class value to a local ...
jschleicher's user avatar
0 votes
1 answer
59 views

Pitfalls or risks in having a scheduled job run every 1 minute

I've got a requirement to know which Contacts are associated to Open Opportunities, and it needs to be known very quickly upon OpportunityContactRole creation. As we all know, OpportunityContactRole ...
Mike's user avatar
  • 1,179
0 votes
1 answer
381 views

'Always Run Asynchronously' option in developer console returning 10000ms CPU time limit

Running a test class via developer console in sandbox with 'Always Run Asynchronously' option checked. Why does Limits.getLimitCpuTime() return 10000ms in this context and not 60000ms?
Lightning Evangelist's user avatar
0 votes
1 answer
118 views

how to avoid Async callouts inside trigger

i have below trigger. How to separate callouts out of for loop. trigger userAttach on Attachment (after insert,before insert) { for(Attachment att: [select Id, Name, body, contenttype, Parent.Id, ...
Jack vardy's user avatar
0 votes
1 answer
1k views

Asynchronous Apex Limits

I was recently trying to create a set<id> myset, and then perform around 600 .add('...id...') calls, and finally select some records based on myset values. When trying to execute it it was ...
Marc Zaharescu's user avatar
0 votes
1 answer
2k views

Governor Limits for Asynchronous Methods

I am aware that async apex methods have higher governor limits. Can someone let me know how "higher" the gov limits for a Async job is ..some kind of numbers or reference link would be great. If a ...
Varun's user avatar
  • 3,073
0 votes
1 answer
30 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 ...
Dash Foster's user avatar
0 votes
0 answers
50 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 ...
Oupat's user avatar
  • 723
0 votes
1 answer
42 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 ...
Sarvesh's user avatar
  • 998
0 votes
0 answers
42 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
3 4
5
6 7