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

learn more… | top users | synonyms (1)

1
vote
2answers
26 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
29 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
24 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
34 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
38 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
0answers
41 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
45 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
18 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
19 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
31 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
34 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
70 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
13 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
10 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
56 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
37 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
59 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
89 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
59 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
35 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
34 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
82 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
22 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
30 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
77 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
85 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
861 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
44 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
47 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 = ...
4
votes
3answers
131 views

Date reminder using apex

I want send a reminder to a contact owner for birthday reminder based on the birthday field in the contact object. If the birthday falls on week day notification has to be sent on the same else if on ...
0
votes
0answers
14 views

Batch apex error “Apex CPU Time limit exceeded error” [duplicate]

I have created batch apex class to insert records into salesforce but i got an error i.e."CPU time limit exceeded error" Please help me to solve this error. global virtual class InsertProductData ...
0
votes
0answers
27 views

How to display or customize schedule report options in custom visual force page ?

I need to have some schedule reports functionality in my custom vf-page to let the user setup some scheduled reports. Is it possible to integrate this part of the default Schedule Report Page in my ...
2
votes
0answers
85 views

Best approach for creating Junction object with millions of records

I have two objects Object1 and Object2 in Salesforce. These two objects doesn't have Master-Detail relationship. But they are related through a Text column X. I want to create many to many junction ...
1
vote
1answer
120 views

Batch apex error in apex job : Exceeded max size limit of 3000000

Using Batch apex i am trying to Insert new records in to custom object from json string in salesforce from API url. When my batch apex class run i got this error in apex log. please explain me
2
votes
1answer
100 views

Invoke a workflow from Apex Class

I have a workflow that needs to be run daily to check is the status of a particular file is completed or not. If the file is not completed then the workflow should be triggered and a Email alert ...
0
votes
0answers
52 views

Design Approach: Apex Callout limits

I am developing an appexchange managed application intended for multiple subscribing organizations and as a part of requirement my managed application needs to make an extensive API callout to an ...
-1
votes
1answer
120 views

How to remove the row from a Visual force page using Apex Scheduler class?

I am Saving dates in 2 fields like follow, Using Visual force page and controller to enter multiple Row's, now i want to delete a row if the End Date is Passed Today, Can any one help me how to ...
1
vote
1answer
55 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- ...
2
votes
1answer
77 views

Session ID invalid when Schedulable class runs

I have written the code below to call a future method from a scheduled class. The problem is that the session Id is expiring by the time the scheduled class runs and hence the future method is never ...
1
vote
1answer
61 views

Managing CronJobs from Apex / ApexAsyncJob Issue

Been talked about before and the requests were delivered in Winter 14 (CronJob Name) But I cannot seem to find the relationship between the ApexAsyncJob and the Actual CronTrigger If I abort the ...
0
votes
0answers
58 views

Updates by apex class are partially successful,unable to debug

I have a batch apex class in production that deals with custom objects Call2_vod__c and Hcp_Depth_Tracker. Finds out number of calls with same Account field and Territory field value and updates the ...
1
vote
1answer
24 views

How do I get the name value of an object and assign it to a string via it's lookup?

I've got a bit of a crazy maze of code, the rest of the code is working so it's not super relevant, but because of the way our objects are constructed (and the specifics of how they want the class to ...
0
votes
1answer
163 views

Scheduled Apex job stuck in queued status

I've created a scheduled Apex class to calculate the donor level (think 'gold', 'platinum', 'bronze', etc.) for a contact based on the amount donated. The class is fired by a trigger when new ...
0
votes
0answers
21 views

How best to implement a rolling Archive that runs without User Intervention

In this case I have a custom object that grows by up to 7,000 records a week(but the same issue could apply to any standard object). I want to have a rolling archive that archives off records that ...
1
vote
2answers
184 views

Error [System.HttpResponse[Status=Unauthorized, StatusCode=401]] when updating currency table

Code: global class CurrencyExchangeRateScheduler implements Schedulable { public String sessionId; public CurrencyExchangeRateScheduler() { String username = 'username'; ...
2
votes
1answer
196 views

Compile Error: sObject type 'Custom__c' is not supported in Managed Package

I'm creating an apex class that implements Schedulable and in the execute it queries a Custom Object but I can't understand why I'm getting this error when trying to query. Some other related ...
-1
votes
1answer
79 views

Scheduled Apex Job for field update

I am new to Apex and I need help with scheduled apex job for field update. The apex job should run every day during the last 5 days of each month. It should check if "Last Status Report__c" field ...
1
vote
1answer
59 views

Email Notfication based on the field value

HI I have the following field value. type (pick-list) values [daily, weekly] Count (number). end date If I choose daily and 2 in the above field. two mail should send to the owner. till the endate ...
2
votes
1answer
88 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 ...
1
vote
0answers
41 views

Apex Scheduled jobs stopped executing unexpectedly

We have 2 scheduled jobs which are executing hourly basis in our app. In few of our client's org, they stopped executing unexpectedly. They are shown in Setup->Monitoring->Scheduled Jobs But, the ...