Apex that runs at a specified interval (similar to a cron job).

learn more… | top users | synonyms (1)

0
votes
3answers
23 views

Where to find Batch job error logs?

We have two batch jobs that run just after midnight. When I run it manually via the Developer Console Anonymous window, they run fine. But last night, the "Apex Jobs" window showed that they failed. ...
4
votes
0answers
33 views

When are the Queueable/Batchable penalties going to be enforced?

According to The New Apex Queueable Interface, from October 2014, we were told that chained Queueable calls would be exponentially delayed up to 64 seconds, chaining Batches would be exponentially ...
2
votes
3answers
33 views

Is there a way to schedule a schedulable class during deployment using Migration Tool?

I would like to add a schedule to my Schedulable class during the deployment of my code via Salesforce Migration Tool. For example, one might schedule a class as per this example: scheduledMerge m = ...
0
votes
0answers
20 views

Unable to ABORT Schedule job

I am trying to abort Salesforce schedule job using below script list<CronTrigger> con=[SELECT ...
0
votes
0answers
16 views

Retrieve Console Scheduled Apex Command Line

Anyone know how to retrieve the Apex Command Line used to schedule Apex via the Console? A former Dev at our company left things running under their username, and we need to move it to our non-human ...
2
votes
0answers
33 views

Batch job works when run through Database.executeBatch(), but doesn't when scheduled

This one is a bit odd and I'm hoping it's something someone has seen before. I wrote a batch class that implements both Batchable and Schedulable. I found that I was writing schedulable classes for ...
1
vote
0answers
16 views

How can I run batch apex inside of batch apex?

Here's the requirement: Rolls up the number of cases created within the last 30 days to the Account. global class ZW_BatchCaseNumberRollup implements ...
0
votes
1answer
22 views

Testing a scheduled class

I have two methods in a scheduled class. Both resemble the code below. I'm getting the following error when I call the second version. System.AsyncException: The Apex job named "My batch Job" is ...
1
vote
1answer
26 views

Schedule job to run twice a day beginning at 10 AM

I am new to scheduled batch apex jobs. I am trying to run a job every day at 10 AM and 10 PM but the logic doesn't seem to be working. Here's what I have so far Time currentTime = ...
1
vote
0answers
29 views

Queueable vs Schedulable interface - job start time

This blog post - https://developer.salesforce.com/blogs/engineering/2014/10/new-apex-queueable-interface.html - suggests that Queueable should be used in place of Schedulable from now on to avoid ...
0
votes
1answer
30 views

Scheduled / Recurring Apex Within A Week

I am not finding this anywhere in Help at Salesforce or via Google. WHen I schedule Apex via the Developer's Console (a weekly run), is it NOT possible to have the first run in LESS than a WEEK? ...
1
vote
1answer
46 views

Future call inside schedule batch

I am working on case where a scheduled batch calling a future method/class. As salesforce restricts the future call from batch , i am looking for any other alternative or workaround for this . I ...
1
vote
1answer
40 views

apex batch to transfer and delete data

I am using a custom free app from app exchange to collect feedbacks from contacts about cases. The answers given by the contact are saved in a custom app object, but since the app has some ...
3
votes
2answers
82 views

Scheduled Apex Limit Exceeded - Spring 15 [duplicate]

After the Spring 15 update I am not able to schedule more than 5 apex jobs. These are NOT BATCH jobs but are being scheduled using the system.schedule. Before the update I was able to create more than ...
0
votes
0answers
43 views

Deployment Into Production - Dependent class is invalid and needs recompilation

I've scheduleable Apex classes that call 15 batch classes. Each one of the batch class will be executed in series, one right after another scheduled at 20 secs apart. During my unit test, code ...
6
votes
1answer
130 views

How Many Starttest() and StopTest() can I have in One Test Class?

The concept of testing org is still very new to me. I don't think I fully understand it. But can I've more than one StartTest() and StopTest() in my test class as my test requires many cases to ...
0
votes
0answers
37 views

Scheduled Apex Class - Denote Open/Future Task on Lead Records

I am working on trying to create a scheduled Apex class that will check all Lead records for any open Tasks and their due dates. It would then calculate which due dates are greater than or equal to ...
1
vote
1answer
53 views

Need Help: Apex batch Class

I'm still trying to figure out how batch work. My error is SYSTEM_METHOD_ENTRY [9]|Database.getQueryLocator(String). This is what I have so far. I'm trying to upsert a list of records using apex ...
0
votes
1answer
35 views

Need Explanation - Too Many DML Rows: 10001

I don't quite understand when does a transaction ends. I have one class with 10 functions. Each function does approximately 2000 rows inserts or Updates. I have a total DML statements is about 16 ...
2
votes
1answer
39 views

Run Apex Scheduler Quarterly

I need to run an apex scheduler for the first day of every current quarter to calculate the revenue for the past quarter. I've already written the batches, however I need to schedule it to run on the ...
1
vote
2answers
37 views

Can't delete blank class due to “This Schedulable class is in use.”

Note - Ghost Schedulable Classes Blocking Deployment and https://success.salesforce.com/issues_view?id=a1p30000000STwPAAW may be related, but I'm not sure Someone in our org made the poor decision to ...
1
vote
2answers
42 views

Modify field definition using scheduled Apex job

In the current data model of my org, there is a Master-Detail relationship between Account (Master) and Revenue (Detail). I have 12 custom fields on Revenue (January, February, ..., November, ...
1
vote
2answers
43 views

Class to auto-create a record once a day on a schedule

Is it possible to create a class that will automatically add a record every morning at 9:00am? The record will have the same data in the fields it just need to automatically insert every morning. ...
0
votes
1answer
78 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, ...
0
votes
2answers
89 views

How to test Batch apex that executes another batch job

I have a batch job that does the following : Makes Http callout Create Cases Calls the next Batch job (In the finish function) i.e. public Void finish(Database.BatchableContext context) { if ...
0
votes
2answers
46 views

How to track DML operation without using triggers

I am trying to insert/update/delete/undelete records of opportunity team into custom object.This should be acheived without using any Trigger on Opportunity Team. generalizing my question; how ...
0
votes
1answer
146 views

Batch interrupted with 'Aborted by user' error

I have a batch class scheduled to run periodically, but seems that for some unknown reason, it gets aborted(Under Setup -> Apex jobs, Error: 'Aborted by user'). I know that the error means, that ...
2
votes
2answers
130 views

Time-dependent workflow vs Apex Scheduler

On the first of January we had an issue where a lot of Contracts passed their end date. This caused a time-dependent workflow to fire, but there were so many occurrences (15000+) that it took a very ...
0
votes
0answers
37 views

Send Email with Template on Custom Record's email ID

I am having one Email Template which I want to send in an email - How can i achieve that one - String strToEmail=objEmp.Office_Email_c; Messaging.SingleEmailMessage email = new ...
0
votes
1answer
67 views

Cron Job scheduler

I have a trigger that calls a schedulable class. The trigger fires on insert and I want to set my schedulable class to run 1 hour and 1 minute after the insert occurs. I was calling my schedulable ...
0
votes
1answer
36 views

Creating a many opportunities from contacts once a month

I'm new to Apex/SalesForce and I'm trying to figure out how to create a scheduled job to create many opportunities based on Account information. It needs to create opportunities for all contacts with ...
0
votes
1answer
73 views

Salesforce: Is there any way to set System time in test class

So I have a trigger and a schedule class. The trigger will fire upon update on an object and schedule a job which will execute the scheduled class. There is some logic in the trigger related to ...
4
votes
2answers
92 views

Why is this Apex Class dependent on a bunch of completed Apex Jobs?

I've got a Batch Apex Class like so. (It happens to use the Dan Appleman decoupler pattern, augmented for batch. Thanks Dan!) public with sharing class Dispatcher implements ...
0
votes
0answers
23 views

How to Delete Account Related Attachments Using Batch Apex?

Hi Please Tell me anyone, How to Delete Account Related Attachments Using Schedule Apex or How to Take Related Account Attachments to bring SOQL Query ? Thanks in Advance
0
votes
0answers
19 views

Post on Case owner after 1 hour from case created time

I am beginner, kindly advice me how to get the logic. the post must me posted on chatter Feed of the case owner after 1 hour from case created time. global class PostFeedOnCaseOwnerChatterFeedClass ...
3
votes
1answer
90 views

is it possible to call a single batch job from multiple schedule apex?

Hi i would like to know is it possible to have multiple scheduled Apex calling a single Batch Apex? The reason why i have multiple schedule apex is becaus different each 1 excute a different record ...
1
vote
2answers
42 views

Schedule Class does not reach 100% coverage

I created a schedule class to run an update for all leads created 5 days ago On the test class, I do create a lead BUT I can't set the scheduler to run 5 days AFTER the lead was created (Today + 5 ...
3
votes
1answer
88 views

Do we allow CRUD & FLS in each component of Apex?

Can I write CRUD & FLS Enforecement codes in following : If not in any of these - then Why ? Apex Class - YES Apex Trigger - ? Apex BatchClasses - ? Utility Classes - ?
2
votes
0answers
209 views

Apex code to Export Csv file to ftp server

I have to write an apex batch scheduler to send user information csv to some ftp server. I am able to generate the csv file with user records but I don't know how to send this csv file to ftp server ...
0
votes
1answer
241 views

Apex Batch : You have uncommitted work pending. Please commit or rollback before calling out

I have a batch class that makes a external Http callout to create case records with a CreatePublicStuffCases() which is called in the start(). In the execute function, I have another callout to get ...
0
votes
1answer
48 views

Send Email with the body formatted

...I am trying to send a single email in the finish part of the Batchable class where the body of the email is formatted. Basically, I want to populate the body with lists of Accounts previously ...
2
votes
0answers
65 views

how to schedule an Apex class with multiple queries?

hi how can i schedule to run an apex class with logic below select all contact records select all campaign where start date in year 2014 select all campaign members where campaign in no.2 loop all ...
0
votes
1answer
106 views

Apex Batch job to get Users information

I am new to the salesforce. I am working on the Apex batch jobto get Users info which is class User and stored into the csv/text file. I want username and user emailid stored of All users and this ...
3
votes
0answers
30 views

Does 'Deploy with Active Jobs' work for managed packages?

So there's this new feature: 'Deploy with Active Jobs' It lets you deploy batches and schedules even if they're running. This is great for changesets. Does it work with managed packages?
2
votes
1answer
63 views

Unable to update metadata (picklist values etc) after post install script is executed

Once a managed package is released, we have to perform several manual steps such as update picklist values, add field to layout, update field level security etc. And there are around 100's of ...
3
votes
2answers
104 views

Scheduled Apex Job that throws errors causes all queried records to never update again in future runs

We have an Apex class that runs nightly at 1am (implements Schedulable). The class queries all records where the NextDate field is <= today. For all those records, it then updates the field to ...
3
votes
1answer
199 views

Does scheduled Apex use synchronous or asynchronous governor limits?

People tend to lump "batch" and "scheduled" Apex together, given that the former is often invoked from the latter. The way they're talked about, it's easy to think that they are both examples of ...
10
votes
1answer
877 views

What happens to scheduled jobs set to half past midnight, when the clocks go forward or back?

Trust our team tester to think of this one! When the clocks go forward in Spring there is no time from 00:00 to 01:00. When the clocks go back that time period duplicates. Is Salesforce clever ...
3
votes
1answer
68 views

how to schedule job with start and end?

I want to schedule a apex classes through apex code and need to have a cron expression with a fix startdate & enddate. It needs to be also possible to set the startdate & enddate like below: ...
1
vote
2answers
56 views

Can any one correct this one why batch apex is not deleting records?

Here is my batch apex .it is not deleting records global class BatchProcessorder implements Database.Batchable<sObject>{ String query; DateTime lastTwoDays = ...