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

learn more… | top users | synonyms (1)

-4
votes
0answers
9 views

How to schedule the post on case after 1 hour from created date [on hold]

global class PostFeedOnCaseOwnerChatterFeedClass implements Schedulable { public static String Cron_Exp = '0 0/2 * * * ? '; global void execute(SchedulableContext SC) { List<Case> ...
0
votes
0answers
7 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 ...
1
vote
0answers
38 views

Scheduled apex to run only twice a day

I have the following Scheduled apex class. The aim is to run batch processes twice a day so i.e : Create case at 12pm, link the cases to accounts at 12:10pm then again at 12am and 12:10am. However, ...
3
votes
1answer
38 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
36 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
46 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
41 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
37 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
21 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 batched ...
2
votes
0answers
26 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
70 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
20 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
27 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
63 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
54 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
855 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
33 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
42 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
123 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
22 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
77 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
86 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
65 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
38 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
83 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
54 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
71 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
54 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
51 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
22 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
90 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
130 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
108 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
66 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
54 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
74 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
38 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 ...
0
votes
1answer
65 views

not getting output for schedulable batch class

global class BatchClassExample implements Database.Batchable<sObject> { global integer i; global list<sObject> start(Database.BatchableContext BC) { ...
1
vote
2answers
117 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 { ...
1
vote
1answer
46 views

How can I query the class which the schedule job will call

I am trying to get the name of the schedule / batch classes called by the schedule job Trying this select Id,CronJobDetailId,CronJobDetail.Name, ...
1
vote
0answers
31 views

Change Email Language, Not Based On Running User's Language

I created a scheduled job which sends an email to System Administrator everyday. The scheduled job works in English and Japanese. I created a custom label and used translation workbench to translate ...
3
votes
1answer
61 views

Invocation of scheduled class : starts - schedules - completes without a trace. No debug log

I've got an Apex Class that implements System.Schedulable which I'm trying to run: public class Broker { //... public class Worker implements System.Schedulable { public void ...
1
vote
1answer
252 views

Unable to query CronJobDetail.Name from CronTrigger in Apex

I have been implementing Dan Appleman's solutions since his appearances at Dreamforce, and am currently working with his Going Asynchronous solution and running into a snag. I put a partial solution ...
1
vote
1answer
25 views

Related to scheduling :How insert a list in spite of one of its element is having exception

I have set scheduling on Lead in which on daily basis a SMS and a mail gets deliver as a reminder to client. But when there is an error in email id and salesforce display an error that mail id is not ...
2
votes
1answer
311 views

How to re schedule a batch if already 5 apex batch jobs are running

I am trying to schedule a batch after 15 mins from my post installation script which take 100 records and process it. But it might be possible that when my scheduled job will start already another 5 ...
1
vote
1answer
125 views

Getting null pointer exception running a batch apex

I am getting an error like "Argument 1 cannot be null" while running this batch apex Batchupdate_Montly_DepthTracker. Please note this batch runs on result sets returned from a scheduled apex. ...
0
votes
2answers
109 views

Apex batch getting an error out

I have this Apex batch having issues with call. I am new in this apex-world. Can someone help me out. My code is here. global class Samplelotinactive implements ...
1
vote
1answer
84 views

Tooling API and Scheduled Batch Apex - How to access

Without storing a users credentials to salesforce how can one access the tooling API during a daily scheduled batch? Currently we are storing the users username and password in encrypted fields but ...