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

learn more… | top users | synonyms (1)

1
vote
0answers
15 views

Tips to prevent errors in execution of time-based workflow?

Our implementation includes a number of time-based workflow rules. Due to high volume, we have been experiencing frequent occasions where execution of updates to some records in the time-based ...
1
vote
1answer
24 views

calling two separate methods in an schedulable class depending on the input/context

I have an schedulable class that does two jobs (in two separate methods). I want to be able to specify which one of the two methods to be called when I schedule the class using class.schedule(). Is it ...
2
votes
0answers
12 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 value "DELETED". Based on the ...
0
votes
1answer
17 views

Compile Error: Variable does not exist: loginstring at line 49 column 42

I'm getting a compile error at line 49 column 42, saying variable loginstring does not exist, but it seems to exist at line 38, what am I doing wrong? global class cstschedulable implements ...
0
votes
1answer
42 views

Compile Error: Method does not exist or incorrect signature:

I'm working on a schedulable class that makes and http callout, I need my schedulable method to start my @future method with my callout. The error I'm getting is " Method does not exist or ...
2
votes
1answer
28 views

Stop stuck Apex Jobs

I have the following problem. There is Apex Jobs that stuck in 'Queued' status - and because of this Schedulable class can't be modified. I want to remove this job, but... System.abortJob fail ...
1
vote
1answer
13 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 ...
1
vote
2answers
32 views

Scheduling Apex class twice a day

I want to schedule my apex class to run twice a day, i.e 8 AM and 8 PM How this can be achieved? What will be the desired cron expression?
1
vote
1answer
24 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 * * ...
0
votes
1answer
21 views

Scheduled Apex Constructor is not visible

I created a managed package and install into a production environment. From the developer console, I tried to schedule the one of the class of the package. zw.ARTaskWebServiceCalloutsScheduler m = ...
0
votes
1answer
23 views

Apex Batch Job Chaining Limits

What is the stack depth for apex batch job chaining? I am conditionally calling the same batch job from the finish method.. Also the solution implemented calls a normal batch job from the finish ...
1
vote
2answers
79 views

Is it possible to use Apex Scheduler to run a batch class just once, 30 seconds after the scheduler is called?

I want to call a Schedulable class from within a trigger, to execute a batch job after waiting 30 seconds (or 5 seconds, as long as it's long enough to make absolutely sure the initial trigger ...
4
votes
0answers
26 views

Deploy with Active Jobs - active job ignores deployed code on next scheduled run

I have an anonymous Apex scheduled job that runs every three hours on the hour: String cron = '0 00 07,10,13,16,19,22 * * ? 2015'; MyScheduledDispatcher sd = new MyScheduledDispatcher(); ...
-1
votes
2answers
39 views

how to schedule job every month first monday at 10 o'clock in salesforce?

can you please give me the example of above scenario.How to solve above solution please give some ideas.
2
votes
2answers
32 views

How do I scalably run Apex after a small delay so that all related objects exist?

I'm trying to run Apex code that runs a little while after custom objects are created. The problem is that I have a few systems inserting and updating data when a customer places an order in an ...
1
vote
3answers
75 views

save the apex class getting some problem

I m not understanding actually how we can fix this type problem , when i edit apex class after that doing save process but i got that type issue Compile Error: This schedulable class has jobs ...
1
vote
1answer
59 views

Are Process Builder workflow rules more likely to violate CPU Time limts than a standard/old workflow rules?

I think so and I'm wondering if others have seen similar issues. Our org has nightly job, very simple code, just updates Contact records if it meets simple criteria. It's been running for months ...
1
vote
1answer
42 views

Apex batch execute method not being called

I have the below batch code global class BatchClassAccountSched implements Database.Batchable<SObject>, Database.AllowsCallouts, Schedulable { global Database.Querylocator ...
4
votes
2answers
241 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 ...
3
votes
0answers
17 views

Force new execution of a Report within Apex logic using ApexPages.PageReference()

I am executing a report to send as an email attachment in a Schedulable class. I'm running this every day. The problem is that it's not creating an updated version of the report each day. It just ...
0
votes
0answers
32 views

how to write scheduled apex in salesforce?

global class MySchedulableClass implements Schedulable { global void execute(SchedulableContext ctx) { CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger ...
2
votes
2answers
42 views

How to write test class for Schedulable class [closed]

global class ScheduleBatch implements Schedulable { global void execute(SchedulableContext sc) { BatchArticleUpdateCase batch = new BatchArticleUpdateCase(); ...
1
vote
0answers
46 views

Send email to Users at 11PM in a Scheduled class. Each User has different time zone

I want to send email to users at 11:00 PM, When certain criteria is met. I tried to accomplish this by Time-Based Workflow rule, but failed, as we cannot run a workflow rule on a specific time of ...
0
votes
2answers
51 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
39 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
54 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
40 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
35 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
171 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
53 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
24 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
54 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
61 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
45 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
21 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
122 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
84 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
63 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
43 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
47 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
181 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
232 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
35 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
43 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 ...
3
votes
1answer
239 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
104 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
99 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
31 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
165 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
243 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. ...