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

learn more… | top users | synonyms (1)

1
vote
1answer
15 views

Scheduling expression

Scheduling expression is 0 0 7 * * ? which means: run every day (weekdays +weekends) each month each year at 7AM but when scheduled job is created the settings are the following:
1
vote
1answer
31 views

.Net to Salesforce Integration

I used EnterPrise WSDL for Salesforce integration. I was able to access the Account,Lead,Contacts, etc. objects. I need one help. Is it possible to get Apex Job Schedule from .Net?
11
votes
0answers
53 views

InstallHandler runs under a special ghost user. What rights does it have?

When you install a managed package with a post-install script, Salesforce creates a special ghost user under which all of the post install activities occur. I think this is undocumented. Here are some ...
3
votes
2answers
58 views

Scheduled batch “already scheduled”

I had a batch job that I tried to start. Its "startup" method that launches it checks to see if it's already running by querying the asyncjob object, then starts it only if it's not running already ...
1
vote
1answer
43 views

Make Test Class Specific to Scheduled Apex

I was wondering if there is a way to make a Test class only run for the Apex Class it's made for. Every time I want to import new classes or triggers, I have to turn off all of my scheduled Apex, then ...
4
votes
1answer
59 views

Apex scheduled job to call .net web services hosted in IIS periodically

I just wondering if someone could guide me to a document of how to perform Apex scheduled job – To call .net web service hosted in IIS of external server on a periodic basis. My requirement is every ...
1
vote
3answers
53 views

Why is this test not getting 100% coverage?

here I created scheduler class that will schedule at every 5 mins. and G1_count field will update in every 5 min. i have covered 77% of code but I want it up to 100%... I don't know what I am missing ...
0
votes
1answer
52 views

how to test the batch code?

How to write test class for this code 75% coverage or not? global class SearchAndUpdate implements Database.Batchable<sObject>,Schedulable { global final String Query; public ...
1
vote
1answer
45 views

Re-ownership of scheduled job from managed packages

One of my orgs has a managed package in it, and was installed by a previous user, who has now been deactivated. Firstly therefore, this means I notice that on the package detail page, it is "Installed ...
0
votes
3answers
61 views

update object1 field based on object2 records

I have written this code its working but I have to write this same code in batch apex. How to do? thanks in advance. trigger rrr on Demand__c (before insert) { for(demand__c d:trigger.new){ ...
5
votes
3answers
237 views

Apex test class for schedulable class that checks for 5 batches running already

I've setup some chain execution batch classes. For this setup we decided to chain the batch classes through schedulable classes. We thought it might be a good idea to include a check for 5 batch ...
0
votes
2answers
60 views

Schedule a trigger

I have a date field on my page, and I want to invoke the trigger at the particular date and time that user selects, can anyone suggest me a way to do it thanks.
-1
votes
1answer
137 views

Batch apex class to update a field [duplicate]

The requirement is i need to write a Batch Apex Class to update Case status field to close when related tickets field status is closed. The update of status should be after 7 days of all the tickets ...
0
votes
0answers
33 views

The batch job that changes Income Timing every new quarter is not working

global class QuarterlyRollupBatch implements Database.batchable<Opportunity>{ Public Date lastDateOfThisQuarter,fiscalYearStartDate,firstDateOfNextQuarter; Public Integer quarter; ...
0
votes
0answers
144 views

Scheduled Batch Apex class

I need to write a Scheduled Batch Apex Class on two Objects Case and Ticket__c. Note: Ticket__c Has a look up to the Case. So, a case can have multiple tickets but a ticket can only be associated to ...
5
votes
2answers
56 views

System.StringException thrown when aborting a job in a rest controller

This code works in an Execute Anonymous window, but not when run from a rest controller: @RestResource(urlMapping='/scheduler') global with sharing class SchedulerController { ...
0
votes
0answers
67 views

Help writing ScheduleBatch Apex class

I have to write a Schedulebatch apex class on two objects Case Ticket__C Ticket__c has a lookup to case and a case can have many ticket records but a ticket can only be associated to one case ...
4
votes
1answer
44 views

Is there a way to load an internal Salesforce page from a scheduled batch?

My end goal is to be able to send license usage as well as data/file storage usage from clients to our org. As these values don't appear to be available directly via any API calls, I had to resort to ...
0
votes
1answer
54 views

Can a schedule be executed from future method?

One cannot execute a batch from a future annotated method. It is also impossible to have a trigger reacting to changes in future calling a batch. I cannot find if it is possible to execute a schedule ...
1
vote
1answer
43 views

How do we stop all scheduled batch

We had scheduled batch jobs through developer console System.schedule('Job1', '0 * * * * ?', new scheduledMerge()); System.schedule('Job2', '0 15 * * * ?', new scheduledMerge()); ...
8
votes
2answers
555 views

Calling future method from Batch

I have a requirement where a future method need to be called from batch apex ,I came across various articles stating that a future method could not be called from the batch. Is there any alternate ...
0
votes
1answer
450 views

Test Class for batch apex scheduler

I have a problem in achieving 75% + code coverage for a test class which i have mentioned below please correct me where i'm going wrong. Now i'm getting 57% code coverage. Here is the apex scheduler ...
1
vote
2answers
70 views

how to complete 100% test coverage for scheduled apex class

I have created one scheduled class for weekly schedule and also created test class for it....now i done with test code coverage..but it only showing 50% of code coverage... what i am missing? Apex ...
12
votes
1answer
261 views

How to deploy apex classes that are scheduled

This is related to Is there any way to unschedule an apex scheduled job programmatically?. I noticed user320 mentioned there is a way to use Type.forName to decouple your classes from the scheduled ...
1
vote
1answer
245 views

How to schedule Batch Apex to run once in a year

I'm a very much new to apex coding and I'm stuck with this problem kindly help to come out of this problem. Scenario : I have a one custom object called child__c and i have a custom field by name ...
12
votes
2answers
354 views

Is there any way to unschedule an apex scheduled job programmatically?

Is there any way, either using apex or the API to unschedule a scheduled job?
2
votes
2answers
252 views

How to overcome the 2000 row limit for analytic snapshot entry?

So there is a 2000 limit of rows per analytic snapshot, and there is an idea to remove that limit. Until than: How can I have more than 2000 rows from the Analytic Snapshot entered into Salesforce? ...
0
votes
1answer
47 views

want to schedule multiple queries with multiple time frequencies

want to schedule multiple queries with multiple time frequencies query1: want to schedule for every 1 hours query2: want to schedule for every 6 hours query3: want to schedule for every 12 hours ...
0
votes
0answers
29 views

Deployment error: Apex class has Batchable or Future jobs pending or in progress; Schedulable class has jobs pending or in progress [duplicate]

I'm getting this error when trying to deploy code using ANT to one for my sandboxes: "Apex class has Batchable or Future jobs pending or in progress; Schedulable class has jobs pending or in ...
4
votes
1answer
382 views

Scheduled Apex, Callouts and Running a Batch

I don't think what I am trying to do can be done with my current setup, but before I embark on some rework, I just wanted to check I haven't missed an approach... I have a scheduled class that ...
3
votes
3answers
426 views

SessionID problem in Schedule Batch class

I have my below batch code and i need to schedule it daily at 12.00 AM. The batch runs but nothing gets done due to the session ID problem. How to solve this problem. public class updateCurrencyBatch ...
2
votes
1answer
309 views

How to specify the below in System.schedule Method in salesforce

I want to write in apex code below of the following to use in System.schedule Method. For Daily i can use this String sch = '0 0 00 ? * MON-FRI'; How would I schedule a job with the following ...
1
vote
3answers
995 views

How can i call a schedule class execute method from normal apex class or apex trigger?

How can i call a schedule class execute method from normal apex class or apex trigger. I also need to pass some variables like(daily,weekly,monthly) based on which i like to schedule the class like ...
2
votes
2answers
1k views

Test class for batch apex

could anyone help in writing a test class for the following code global class CaptureLastLoginDate implements Database.Batchable<sObject>{ //This is the query that is passed to the ...
0
votes
1answer
95 views

Batch Apex on LastLogin

I'm trying to use batch apex on Lastlogindate. I have to capture the system generated lastlogindate into a custom field .Here is the code global class CaptureLastLoginDate implements ...
0
votes
0answers
39 views

Creating trigger based on LastLoginDate of Account Owner

I have to create a trigger based on LastLoginDate of a record owner.I have some doubts regarding use of trigger event before update. Suppose user is not Logging in for some days , will the trigger ...
6
votes
1answer
274 views

Long Text field in Report Workaround

So I know that Rich/Long text fields will automatically get truncated when running a report in the UI or when trying to schedule a report. I get this and think this is something that should be in ...
4
votes
1answer
619 views

How to get UserInfo.getSessionId() in Scheduler/Batch

I am building sfdc application that required me to call and do add/update using Http method at vendor application in external server daily. They created one account for me in their application. In ...
4
votes
2answers
369 views

Schedulable calling a batchable: doable? testable?

I have a process that needs to run once daily. It will first need to make a series of callouts to get information (sms email address) to update contacts, and it will then need to send emails using ...
2
votes
0answers
96 views

I want to insert, update and second time when I run Batch Class it should not add inserted records

I want to sync all Users record with Contact. I have only one Account where I want to sync all the User records. Now I am able to insert the records with Insert call of batch apex. But I am not able ...
3
votes
1answer
114 views

system.IsScheduled() and Test Classes

This seems wrong to me, but maybe I am missing something simple... I have this class: global class GoogleAnalyticsImportScheduled implements Schedulable{ global void execute(SchedulableContext sc) { ...
4
votes
2answers
178 views

Deleted scheduled jobs still appearing?

I have a legacy process that has created about 2000 scheduled jobs over 12 months. They are all appearing in the Scheduled Jobs list in the UI. However, when I query the CronTriggers object, I see ...
2
votes
1answer
69 views

Batch class is failing - giving timed out error

Batch class is failing. Giving timed out error. Can anybody suggest anything? My query is, SELECT Id, Name FROM TestObject__c WHERE Test_Date__c < TODAY and Test_Date__c != null and isDeleted = ...
9
votes
2answers
284 views

How can I change an objects record type after a certain time period? Workflow, Apex, other?

I am working on implementing a timed RecordType change in salesforce. I have an object that when created needs to change its RecordType after a certain number of days. The only catch is that if a ...
5
votes
1answer
153 views

Unable to delete class due to scheduled job pending, but no scheduled jobs listed [duplicate]

I have classes which I cannot remove because they are in a scheduled job. When I go to Apex Jobs I should be able to see which job they are in, however I cannot find them. There is no Scheduled Apex ...
5
votes
3answers
216 views

Has anyone else experienced issues with the apex job scheduler?

The follow scheduled apex jobs highlighted below (in yellow) are configured to run daily, and were scheduled to start this morning - however, they have not ran since 10/12/13. Has anyone else ...
1
vote
2answers
175 views

code coverage for batch class

How can i get increase coverage for this code? I get only 55% so far. Also, when I am doing an assert, it should not be equal to '0' but for some reason if i do that then it complains saying it ...
4
votes
1answer
248 views

Where do I put APEX scheduling code?

Not for the first time I've drawn a blank with the Salesforce documentation and feel like I'm asking a simple question. I have written an Apex class that implements Schedulable. The job will be part ...
7
votes
2answers
874 views

Too many SOQL rows returned (limit exception) - 50001

I am getting Too many Soql rows returned:50001 (limit exception) on below line of code list cvlist= [Select c.Id, c.ContentDocumentId From ContentVersion c where c.Syn_Documents__c!='']; global ...
3
votes
2answers
1k views

Best practices for monitoring Scheduled Apex and Batch Apex?

We have multiple Apex jobs running, both from Schedulable and Batchable code. While an attentive SA could examine the Apex Jobs list to check that everything is OK, it seems a better idea to have ...