Questions tagged [scheduled-apex]

Issues with writing, running, or testing scheduled Apex code, using the Schedulable interface.

Filter by
Sorted by
Tagged with
0
votes
1answer
44 views

How to iterate map inside a map

Hi I have a map which has a map inside a map as below Map<String,Map<String,String>> finaldataelementmap=New Map<String,Map<String,String>>(); Map<String,String> ...
2
votes
1answer
48 views

Impact of Freezing SF User - scheduled jobs, reports, oauth tokens

We are going to do one big release (deployment, configuration, data load) in our prod org and need to have some sort of maintenance window to prevent users from interacting with SF org. Freezing all ...
1
vote
1answer
29 views

Schedulable Apex Class to update fields in Lookup record

I have a Custom (Managed) object called Individual Email Result (et4ae5__IndividualEmailResult__c) which contains a Lookup field to a Contact record (et4ae5__Contact__c) and I want to create a ...
0
votes
0answers
11 views

queuing batch controller which has Outbound calls to get record details from external appilcation

I am requesting external application from SF on daily basis to get records and sync. I have 5-10 custom objects in our environment. I have to make API calls individually to get all those records and ...
0
votes
1answer
21 views

How do I test a schedulable email sending?

I have a schedulable apex class for the email sending. I tested a schedule, but I can't to coverage sending logic. Is there a some way to test good and bad scenarios for it? My class: public class ...
2
votes
1answer
30 views

Need advise on callouts and inserting/updating new records from external system

We have an external application where few records gets updated or created on daily basis. We already implemented inbound calls to salesforce but it is scheduled for once a month. We need to schedule a ...
0
votes
0answers
19 views

Scheduled Class within a Batch Class

I am trying to schedule a callout from a scheduled class. In order to get around the limitation of sending callouts from scheduled classes, I tried to include the scheduled class within my batch class,...
0
votes
1answer
15 views

How do I send an email based on a date difference?

For example, I have some DateTimeField__c, and if DateTimeField__c - NOW() = 11 (hours), I should send an email. Trigger is not a variant, because I can't check with it a formula field. A Scheduled ...
0
votes
0answers
33 views

Run a Autolaunched Flow created with the new (winter '20) schedule option

I have a flow as described in the title, created with this feature. If I click on the 'Run' button i receive the following error: The flow failed to start because the provided values were not valid: ...
0
votes
1answer
28 views

Salesforce Platform Event After Specific Interval

My Use Case - After Every 5 minutes i need to get a token from "X-System" and need to store in salesforce. To Achieve this we implemented batch and scheduler. What Batch and Scheduler Will DO are ...
6
votes
2answers
161 views

Current state of reliable execution scheduling

A number of approaches to more reliable scheduling and continuous processing have been used over time on the Salesforce platform, all of them suffering from serious drawbacks. These include: suicidal ...
-2
votes
2answers
57 views

How to call report in xlsx file format

could you please help me how to call report Xlsx file format, i am tried to below code, but i am not get the result: public class BatchUtilClass { @future(callout=true) public static void ...
0
votes
0answers
12 views

CPQ Generate Document Apex Jobs Queued Status

When clicking on "Generate Document" -> "Save" within a Quote record. The screen gets stuck loading. I did notice within Apex Jobs there is a lot of jobs Queued.
0
votes
1answer
67 views

I am not get the tabular report body in the attached email [closed]

I am not get the tabular report body in the attached email ,could you please help me. global class Exportertest implements Schedulable,Database.AllowsCallouts{ global void execute(...
0
votes
1answer
37 views

Upsert error with apex batch job

I have a custom object named AttendanceRate with 5 fields "AttendanceRate_' + weekDay + -'__c' for each day of the week. When a user creates an activity, he has 100% of attendanceRate for this day, ...
1
vote
0answers
13 views

Get the Schedules of Aborted Scheduled jobs

One of my team members has mistakenly aborted all the scheduled batch jobs from the system using the below code - List<CronTrigger> jobsToAbort = [select Id from CronTrigger where ...
0
votes
1answer
46 views

Code efficiency when using same content in multiple method in same class

what I should learn and do if I have 3 different methods that are essentially doing the same thing but only the query statement that makes the differences. For instance my code below have 2 methods ...
-2
votes
1answer
44 views

I am not able to scheduling the below code

When I am trying to schedule this below code: global class exportReport3 implements System.Schedulable { global void execute(SchedulableContext sc) { ApexPages.PageReference report = new ...
-1
votes
1answer
21 views

CRON Expressions every hour at specific times

Is it possible to run CRON job every hour at a specific time at that hour? I only ask because I want to spread out my scheduled batch classes throughout the hour to avoid maxing out the flex queue.
0
votes
1answer
33 views

calling two separate methods in an schedulable class based on time interval

I have One schedulable class that calls a method that have multiple if conditions to be executed FOR(Contact cont : contacts){ if(cont.Account....
1
vote
1answer
28 views

ApexLog's field DurationMilliseconds is giving large values for Schedule jobs

I was trying to debug a issue for scheduleable class, I found out that it is taking approx 65,00,00,000 milliseconds which is equal to approx 180 hours. But if I open that debug logs and see execution ...
1
vote
2answers
199 views

How many records can an Apex Batch process

Finding mixed results within web searches, trying to locate a concise answer as to how many records can a batch process. I am creating an apex batch that will run daily. It will query around 55,000 ...
0
votes
0answers
22 views

Test.setMock working in Scratch org but not in sandbox Org

We have batch class used to make an API callout and doing Opportunity upsert DML operation in the Start method. Based on the opportunity's return value, we are making another API callout and doing ...
2
votes
1answer
25 views

CronTrigger records already exist when running Apex test

I get the error message: Assertion Failed: Job already exist: Expected: 0, Actual: 3 When I run this test: @isTest public static void scheduleJob(){ // arrange // assert System....
2
votes
1answer
112 views

Add current stock price to account page

still pretty new salesforce developer, but I was curious what the best approach was to add a companies stock price to their account page in salesforce? I've been referring to the articles below: ...
0
votes
1answer
35 views

How to unit test the method that schedules an apex schedulable class

I have a method that executes the following code , I am not able to find any thing from CronTrigger to verify the scheduled job public static void ScheduleStatusChk(Id batchId, Set<Id> ...
1
vote
0answers
24 views

Scheduled import of leads

I have a requirement whereby leads are imported, but due to a process, they can only handle 5 leads every 10 minutes (inserting a lead triggers an inbound call to an agent). I have come up with the ...
0
votes
2answers
39 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 ...
0
votes
1answer
45 views

How to chain batch jobs when one is from a managed package

I have a scenario where users upload a file and a batch1 kicks off to create the records , once the records are created we pass on the ids we just created to another batch job (batch2) which is from a ...
0
votes
0answers
20 views

Schedule to the batch. By launching a single class (CRON creation) [duplicate]

I want to automation of the different steps by adding a schedule to the batch. By launching a single class (CRON creation). Setup the launch of the multiple phase throughout the time. Example: Phase ...
1
vote
2answers
75 views

Limit on Batch class

If I run a batch class every night, that goes over 10000 leads every night and updates a field. Would I get the limit exceeded error considering the huge number of records?
1
vote
1answer
49 views

I am trying to Schedule Class that will add a new contact under Account every 2 min

I am trying to Schedule Class that will add a new contact under All Account every 2 min and also there should be a validation check that you can not have more than 05 Contacts under a single Account. ...
4
votes
2answers
75 views

how to find out Schedulable class is already scheduled or not?

I have a apex class which implements Schedulable interface, I want to find out whether this class is already scheduled or not? Please help me with SOQL query to find out this.
0
votes
0answers
20 views

Time Trigger - Bulk process handling

I have a time based trigger (action on PB) which when met updates xyz field of account on last day of month. Suppose there were 300 records which initiated this time based Trigger on different ...
0
votes
1answer
47 views

Scheduling Flow

I am trying to create a screen flow that is scheduled in Salesforce. From the screen flow I call an Invocable method where I pass my input parameters from my screen flow. From there I call a future ...
0
votes
1answer
28 views

Schedule class runs instantly

I have a controller of an Apex Page from where I am calling a schedule apex class using system.schedule to run after one hour. From that schedule class, a batch class is being called to run which has ...
2
votes
1answer
23 views

Not Able to get fields from controller to Email Template when the mail is sent from scheulder

It would be great if I could get help with the below requirement that I have to achieve. The requirement is that I run a scheduler in a custom object called Project__c. Around 20+ projects pass the ...
2
votes
1answer
466 views

“Every 30 min” cron expression runs only hourly [duplicate]

I have a Lightning Component where users can choose how often an Apex Batch should be run. As options, I want to allow 30min, hourly and daily. Changing that should modify the CRON expression of a ...
2
votes
0answers
38 views

In a test class example of a Post Install script, sending an email and scheduling a class that performs an API callout

Scenario: In my example, as a part of the PostInstall (class implements InstallHandler) script I will be performing two actions; - sending an email to the installing User for the express purpose of ...
2
votes
2answers
111 views

Is system.schedule(…) @AuraEnabled?

I would like to know if system.scheduled is aura enabled or not. If not is there another methode that can replace it or a way to make it enabled? Edit final public class Plan { @AuraEnabled ...
1
vote
1answer
59 views

How to do this 'GET' through Batch?

I have a void callout class. But I need take all these tools through Batch to make it in Schedule later. How can I convert it into Batch structure with start, execute, finish? public static void ...
0
votes
2answers
55 views

unable to abort queued scheduled job

I have an apex job scheduled by mistake and now I cannot able to delete that. Due to that, I cannot able to edit my existing apex class. I tried the steps from Salesforce.com artice and when I execute ...
0
votes
0answers
89 views

How to make a Callout batch class?

I have a Callout with Lists and Maps. This takes objects from a resource and transfers them to my Lightning Component. How can I create Batch for this? I need Batch to schedule my callouts after every ...
0
votes
1answer
57 views

Schedulable error: You have uncommitted work pending. Please commit or rollback before calling out

I am trying to test Schedulable class which is designed to only run once. Because it's only runs once, I need to test that the System.abortJob is working correctly. I am using this code to test: ...
0
votes
1answer
58 views

Why my Batch is not updating the field

I am having one batch on Accounts which is not updating. I want to put the Sum of all the Normalized Accounts from all the invoices related to Accounts if the Status <> "invoice_canceled" and ...
1
vote
1answer
28 views

How to abort current scheduled job?

I would like to schedule a job to run once in 15 minutes time. According to this article: Run Scheduled Apex job once I need to add some code to the finish method: public void finish(Database....
0
votes
1answer
31 views

How many API calls can be made per hour to a non-bulk endpoint?

Assume that there was a REST endpoint that worked with 1 record at a time, i.e. not bulkified. If we were to use the Apex scheduler to pull down the records into SFDC every hour, what would be the ...
1
vote
1answer
57 views

Schedule Batch Apex too many rows

I am having an issue because I believe I don't understand batch apex/scheduling very well. Every time I use this I get either a SOQL error of trying to query too many rows of 50001, or a DML error ...
0
votes
1answer
36 views

Schedule class from the CronTrigger?

I have a requirement where I need give user an option to schedule a batch in a custom lightning configuration page. I can able to do it when we create a single schedule for a particular Batch by using ...
2
votes
1answer
338 views

System.StringException: Unexpected end of expression

Error: Line: 3, Column: 1 System.StringException: Unexpected end of expression. Class: public class OppSchedule implements schedulable{ public void execute(SchedulableContext sc){ ...