Questions tagged [cron]

The tag has no usage guidance.

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

Scheduled Apex not firing

Still fumbling my way through this problem: Help understand Apex class / bulkilfy I decided to go ahead and create a query in Apex that gets the Leads I need to be reassigned and push those into the ...
0
votes
0answers
36 views

Apex Scheduler - CronTrigger gets created but doesn't run

We are running into an issue with the Apex Scheduler. We've scheduled some code to run every half hour. Since the ".schedule()" method only allow to run code hourly, we call the method twice ...
1
vote
1answer
74 views

Get the scheduled Job name using Apex class name

I have seen many posts about finding out name of the apex class associated with a scheduled job. However, i have an opposite need. I am updating a scheduled class, that was scheduled to run at a ...
0
votes
2answers
102 views

CRON Expression for specific time [closed]

How to schedule batch class to run at specific time 12.30 AM CST Daily. How to make it run at CST Timezone.
0
votes
1answer
230 views

Dynamically Scheduling Apex to Run at Various Points in Time

I see a lot of documentation on scheduling Apex to run repeatedly (i.e. every day at 1am), or even run once at a specific point in time, but I don't see anything about dynamically scheduling Apex to ...
0
votes
1answer
104 views

How to schedule an apex batch class on every 15th and last day of the month?

I have used cron expression -> '0 1 12 15,L * ?' for scheduling the batch class at 12:01 am on every 15th and last day of the month. But it is erroring out.
-1
votes
1answer
26 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.
2
votes
1answer
693 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 ...
0
votes
1answer
61 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
572 views

Get the actual Previous Fire Time of a CronTrigger / Scheduled Apex

I am exeuting Scheduled Apex that should do processing based on the last execution time of the particular code. I query some records for processing and I only want to query those records, that have ...
1
vote
2answers
375 views

Delete cron jobs instead of using abort

Currently I'm using the System.abortJob(job.Id); method to abort the execution of already scheduled cron jobs as per the following code: List<CronTrigger> cronjobList = [SELECT Id, ...
3
votes
1answer
281 views

Which scheduled jobs count towards the max concurrent scheduled jobs limit?

Per the docs we can only have 100 scheduled apex jobs at any one time in most orgs (5 in dev orgs). Which jobs count towards those limits? Would the following query return the right number? SELECT ...
0
votes
1answer
47 views

How to abort Cronjob by name?

I have cronjobs which are scheduled in after update trigger. When some user make an update in one and the same record I need the previous cronjob(batch) to be aborted and to start a new cronjob. How ...
1
vote
1answer
302 views

Find what apex a cronjob Triggers

Scenario: Documentation on my org has a gap regarding a scheduled batch apex. This batch code updates a related list on the lead object. This List and process is call ‘nearby references’ and ‘find ...
2
votes
1answer
231 views

Can not see “Manage” button in Scheduled Jobs

I have System Administrator Profile. The “View Setup and Configuration” checkbox is checked. When my CRON expression is like (monthly): '0 0 3 * * ?'; I can see the "Manage" button, but when my CRON ...
0
votes
1answer
150 views

Apex CronTrigger Throws error while aborting: Job does not exist or is already aborted.

I keep getting this error when I try to abort a scheduled job in my batch job code. Below is my code: Datetime dt = system.now().addMinutes(Integer.valueof(myCustomObject.Time_Interval__c)); ...
0
votes
1answer
144 views

Schedule batch job using cron expression

I have a requirement where I need to schedule a batch job 4 times in a day, at 1 AM EST, 10 AM EST, 3 PM EST, and 8 PM EST. I have scheduled this using a cron expression in Developer Console. I ...
0
votes
1answer
51 views

CRON Check for all iterations

I have a scheduler with the CRON expression as 0 30 13 5-5 9-10 ? 2018-2018 From the above my thinking is it will run from sep 5th to oct 5th of 2018. But it's breaking in month end. Is there a ...
3
votes
2answers
3k views

What's the difference between AsyncApexJob and CronTrigger?

Roughly I know that when I schedule a Schedulable, I'm creating both a CronTrigger and an AsyncApexJob, but I'm confused as to how the two objects relate to each other and what the significance of ...
0
votes
2answers
362 views

Schedule batch execution using API

I am currently implementing scheduled migration of data from external system to Sales Cloud. I would like to migrate data using bulk API and then, after the process is finished, schedule a batch ...
0
votes
1answer
240 views

Test Class for Scheduled Apex

I have a piece of scheduled apex that runs once a month, but behaves differently depending on the month. In attempting to write unit tests the unit test triggers the scheduled apex, but does not do so ...
0
votes
1answer
342 views

Schedule apex every second week

Is there a way to schedule an apex class(schedulable of course) to run every second week? I thought I could do it in the UI by scheduling 2 jobs for 2nd and 4rd Friday of the month, but the moment I ...
1
vote
1answer
776 views

cron expression for running every 2months

Can someone help me with setting the cron expression to run every 2 months starting from a particular day Here is the one which I tried : public static String sch = '0 18 * */2 *';
6
votes
3answers
5k views

Schedule apex one time

I am planning to schedule apex from my class if it meets certain conditions. Is it possible to schedule apex for a single time? If yes is it done using Cron expression or any other method.
0
votes
1answer
53 views

Error in comparing cron expression

I am getting this weird error while comparing Cron expressions but I am not sure what it is indicating. System.AssertException: Assertion Failed: Expected: 0 0 12 1/1 12 ? 2022, Actual: 0 0 12 1/...
1
vote
1answer
552 views

Validating a cron expression

I have a requirement where I accept a cron expression from the user and schedule a job with System.schedule. Before doing that, I need to check if there is an existing scheduled execution for that job ...
0
votes
2answers
278 views

Bug? Same Batch Can Be Run From Cron & Schedule Apex

I have come across a strange case where the same batch job was running with two different users and went in to dig upon and found that one was scheduled via Schedule Apex screen and another one using ...
3
votes
2answers
237 views

APEX trigger with CRON job to check on a custom field

Using the Apex Schedule documentation on Salesforce I have created the following APEX code: global class CheckingDate implements Schedulable { global void execute(SchedulableContext ctx) { ...
2
votes
2answers
162 views

Apex schedule crontab syntax

I want to schedule a batch to run everyday at 1 am. I've tried the following code as suggested here: System.schedule('BatchAccount daily at 5 am', '0 0 1 * * ?', new BatchAccount()); But if I view ...
3
votes
1answer
282 views

Need assistance on scheduled jobs

I have a scheduled job in my org which was scheduled 2 years ago without an end date. It runs every Friday at a specific time, which means it was scheduled using a cron expression. If I delete that ...
4
votes
0answers
103 views

Is This Project Possible?

I'm setting up a Wordpress site for a new customer. They have moved their customer database from a plesk environment to a salesforce database, 13 records per row including address, id, phone number, ...
14
votes
4answers
11k views

Cannot delete AsyncApexJob using System.abortJob

I'm facing the "ghost" job issue in an organization (thankfully is a sandbox). I had a class scheduled to run in a daily basis, and it was working fine, until I accidentally scheduled it again (2 jobs ...
4
votes
1answer
686 views

PDF Generation Salesforce

I'm kinda stuck in the middle of all the limitations Salesforce has for creating a pdf out of a Visualforce page. What I have is a Visualforce page that takes some parameters and I use to rerender as ...
5
votes
1answer
430 views

question on crontrigger and possible state values

Whenever a scheduled Apex Job is submitted, an entry is made in the CronTrigger table. What I see is, when this job is completed successfully, I see the State changed to "DELETED". Based on the SOAP ...
1
vote
1answer
820 views

CronTrigger : set StartTime and EndTime

Is it possible to set the StartTime and EndTime fields of a CronTrigger object ? I'm not able to set this fields in Apex code, I have the error below : Field StartTime is not writeable I know I ...
3
votes
1answer
1k views

Scheduled job : get next execution date

Is there a way to get the next execution date of a scheduled job ? I have my Apex code : Scheduler scheduler = new Scheduler(); // Scheduler class implements Schedulable String expr = '0 0 13 * * ?';...
5
votes
2answers
6k views

How to schedule a job twice a day

I have a job and I have to schedule this Job twice a day. Currently it is running at 12 PM ET and 1 PM ET. So my Cron String looks like this. public static String CRON_STR = '0 0 12,13 ? * MON-FRI *'...
2
votes
1answer
299 views

Multiple timings in a single cron

I want to schedule a job which wil run nightly at 7 PM ET and 8 PM ET. http://www.cronmaker.com/ provides a wizard to construct the scheduling string. Is it possible to schedule both runs in one ...
1
vote
1answer
723 views

Why Deleting Scheduled Jobs with Apex Suddenly Stopped Working March 2015

Any thoughts on why the removeExistingCompletedJobs Method suddenly stopped working around March 2015? We now get an Apex error "Job does not exist or is already aborted" I'm not sure if it coincided ...
1
vote
2answers
1k views

CRON Expression to run half past the hour

I understand how to make a job run on the hour and every hour. Is there a way to schedule the job to run every hour, but half past the hour e.g. 2:30, 3:30, 4:30 etc
2
votes
2answers
5k views

Scheduled Apex - CronExpression Question

I am currently having difficulty in understanding the CronExpression parameter for System.schedule() method. As per doc it says the syntax is "Minutes, Hours, Day of month, Month, Day of week, ...
1
vote
1answer
471 views

The best way to run scheduled jobs frequently (every 30 seconds)

I want to run an apex code every 30 seconds and want to use Scheduled Jobs. However, there are limitations on it. So far I have read the following options: 1- Run it on another server (e.g., unix) 2- ...
4
votes
1answer
797 views

Salesforce Cron Expression for every second and fourth Friday?

I want to run a class at 10 AM every 2nd and 4th Friday of each month. Came up with the expression below, but it's not scheduling correctly - only schedules the fourth Friday. Could it be that ...
2
votes
2answers
4k views

Getting Scheduled Apex Job name in the apex class

I have two scheduled apex jobs ScheduleJob1 and ScheduleJob2. Both these jobs call an apex class implementing the Schedulable interface global class TaskController implements Schedulable { ...