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

learn more… | top users | synonyms (1)

0
votes
2answers
25 views

Batch Apex for Counting number of Contacts associated with Account

I am developing one Batch apex which will count number of Contacts associated with Account object.It will store the count in a field "No_of_Contacts" on Account. I am confuse in how can i write SOQL ...
-4
votes
1answer
25 views

Batch Apex Class Information

In our Sandbox Organization Apex Classes are written in year 2011. Please find below images and Apex Classes information and let me know about what is exactly they do in our organization with apex ...
1
vote
1answer
19 views

Calling executeBatch() method of two Batchable classes in execute method of a Schedule class

I was just wondering is it possible to class executeBatch method of two different Batchable classes inside the execute method of a Schedule class. For example; global class BatchClassA implements ...
2
votes
2answers
14 views

Delete Apex Job submitted by User

How do I delete Apex job submitted by a particular user? Below is what I found online but this script will delete all apex job with status = queued. Thanks in advance. //ApexClass apxClass = ...
0
votes
1answer
26 views

Implementations of Apex Schedulable

I have a requirement to invoked my code on a schedule and since I'm new I could not able to wrap my head around how to implement but here is what I have got so far please correct me if I'm doing ...
0
votes
2answers
45 views

Sample Code to Schedule an Apex class

I'll be working on creating a apex schedule class and I just need a pointer to start is that possible if you can have a working small sample where I can understand how the mechanics work and I have ...
1
vote
1answer
31 views

When is the constructor of a schedulable class invoked?

I have a Class that implements the Schedulable interface and the constructor of this class initialises a variable with the value for the current month. I found out that over the months, the value for ...
0
votes
0answers
22 views

Ghost Schedulable Classes Blocking Uninstalls

I am seeing a similar issue as Ghost Schedulable Classes Blocking Deployment on the opposite end (uninstalls are being blocked). As advised we've been having Salesforce support run the "fix for ...
1
vote
0answers
29 views

Apex Scheduled Jobs Error

I am trying to scheduled a job but I get the following error: You have exceeded the maximum number (100) of Apex scheduled jobs. However when I checked my current scheduled jobs, I see only 2 jobs ...
3
votes
1answer
49 views

Can I have multiple transactions within 1 Schedulable Class?

I have a Schedulable class that does multiple rollups from my Opportunities to their respective Accounts. This seems to work fine until recently I noticed some issues. Essentially my Schedulable ...
1
vote
2answers
35 views

Should use Workflow rule/Trigger/Apex Code

I'm new to SF and working through my way and I need some recommendation or best practice from people who have been working heavily in the SF. My question is: I have the following requirement: if the ...
0
votes
1answer
13 views

I need to Change “From” email in Visualforce template.

We have a daily scheduled apex job that sends email everyday (we use visuaforce email template). I would like to change "From" email address in one specific visulaforce template. I have already added ...
2
votes
1answer
119 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 ...
3
votes
0answers
39 views

Batch jobs sitting in “Holding” status after flex queue turned on

Since turning on the flex queue, I am seeing batch jobs that previously executed near-instantly now sitting in the "Holding" status for a very long time. It appears that only one job per hour (on the ...
1
vote
2answers
47 views

Not Serializable: System.Http exception on Schedulable class

I have a Schedulable class that calls out to a third party GPS service. The problem I'm running into is that when I try to do the initial schedule (via anonymous execution) I get the error: Not ...
1
vote
1answer
36 views

Scheduled Apex Job Delay for Chained Jobs

I've ready several articles mentioning that in Spring '15 there will be a 5 minute delay added for chained Scheduled jobs. This page ...
5
votes
1answer
37 views

API Call in Managed Package behaving differently in Scheduled Apex

I have a Scheduled Apex job, 'scheduleUnsub,' which calls a class 'resubscribeCall,' which runs some code including a method in a Managed Package (ExactTarget) which makes an API call to ExactTarget. ...
4
votes
3answers
83 views

Apex Flex Queue jobs monitoring

I've enabled critical update for apex flex queue in my developer org. Also scheduled more than 20 jobs. Now, I wanted to monitor the jobs but when I go to Monitor -> Jobs there is no option as Apex ...
4
votes
2answers
212 views

Deleting lead if its not active for 15 days

I have a Consent Obtained Date field on the Lead object. If consent is not obtained (date field is null for 15 days), the Lead record and its associated Activities should automatically be deleted by ...
1
vote
2answers
32 views

Schedulable Class not fetching Email template in Else Part

Here is the class OpportunityReminderMail which is called from Schedulable class i have added one new if statement to choose another template while Service_segment__c = ESR but it is not picking up ...
3
votes
1answer
28 views

What do I assert in this test for a scheduled class?

This is my Scheduler class. global class LeadSummary_Scheduler implements Schedulable{ global void execute(SchedulableContext sc) { getCreatedLeadsSummary gcls = new ...
2
votes
1answer
119 views

Scheduled Apex not consistantly executing, sending emails

I'm having a problem similar to this user's question from about a year ago, although it's not clear to me whether the solution provided there actually resolved the issue (or if it just made the ...
1
vote
1answer
63 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 ...
0
votes
2answers
74 views

code coverage 0%

I got an error in the inbound change sets in my production mode and found out that my code coverage is 0%. I created an Apex Class over in a sanbox and I need to get the code coverage to reach 75% ...
0
votes
0answers
20 views

Dependent Picklist throw page error

I have a dependent picklist and controlling picklist both present on Apex Page. Still it throws below error. The dependent picklist 'Outcome' requires its controlling field 'Transaction Type' to be ...
0
votes
3answers
75 views

How to Send a consolidated email for all batch class job finish at the end of the day

We have 2 batch classes which run once both related objects are updated. However, everytime they are updated and the corresponding batch jobs are finished we got email notification. How to limit this ...
0
votes
3answers
102 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. ...
6
votes
0answers
76 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
43 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
1answer
119 views

Unable to ABORT Schedule job

I am trying to abort Salesforce schedule job using below script list<CronTrigger> con=[SELECT ...
0
votes
0answers
34 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
2answers
137 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
21 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
49 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
58 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 = ...
3
votes
1answer
110 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
39 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
69 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 ...
2
votes
1answer
98 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
102 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
192 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 ...
7
votes
1answer
399 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
42 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
86 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
72 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
84 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
60 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
61 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
57 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
240 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, ...