Tagged Questions

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

learn more… | top users | synonyms (1)

3
votes
0answers
9 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
12 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
48 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
33 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
847 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
27 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
38 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
112 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
15 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
64 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
68 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
54 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
31 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
64 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
49 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
61 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
38 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
49 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
20 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
65 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
20 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
96 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
64 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
51 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
52 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
60 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
36 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
58 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
82 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
40 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
27 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
58 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
192 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
23 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
226 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
99 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
87 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
80 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 ...
3
votes
1answer
218 views

Export data to a file using apex

I have a requirement to Run SELECT query on custom object export the data to csv file Automate / schedule step-1 and step-2 . I know how to achieve step-3, by using apex scheduler class. But I ...
0
votes
0answers
18 views

How to provide Scheduled Apex in Managed Pck with the risk of failing ugrades [duplicate]

You read it everywhere. Adding scheduled classes to a managed package is the safest way to big pain. Scheduled classes prevent later upgrades and the like... So what's a better way to add a cleaning ...
1
vote
2answers
134 views

Scheduling Job is not executing on daily basis

I have the same problem which this guy faced and came with a solution. I am not fully satisfied with the solution . The same happen to me that my Apex job does remain as 'Queued' and many times never ...
1
vote
1answer
35 views

Map Value gets overwritten

I have a scheduled Apex job that queries a child object and ordered by the parent Id. Then I have a for loop that groups all the child objects w/ the same parent Id into a list and then cache them in ...
1
vote
0answers
58 views

0% code coverage on apex class [closed]

Hope all is well I have the following class (see below), however i am unable to test my logic, as i am getting 0% code coverage.Can any one help me write a test class for the following class below. ...
0
votes
1answer
89 views

How can I create a campaign map that returns a list of all the campaign members associated with it?

In the Force.com Explorer I can perform the following query: SELECT Id, (SELECT Id,LeadId,ContactId FROM CampaignMembers) FROM Campaign It displays every campaign.Id in one column and the next ...
0
votes
1answer
46 views

Batch scheduler time , status and account

I'm stuck for one of the requirements . Have to check the Status , Time and Name/created by of the Batch Schedular .Have a query working for CronTrigger for this but how do i implement it through ...
1
vote
0answers
250 views

I am executing a Batch Apex class to delete the records from Recycle Bin but the records are not getting delete?

This is my code: global class EmptyRecycleBin implements Database.Batchable<sObject>{ global Database.querylocator start(Database.BatchableContext BC){ string query ; return ...
1
vote
3answers
200 views

Deploy APEX without running all tests

I have 20 scheduled APEX classes, and every time I want to change one or deploy new APEX I get an error for every Scheduled APEX test class like this: Failure Message: "System.AsyncException: The ...
0
votes
1answer
1k views

How to Close Popup and refresh parent window in salesforce?

My requirement is whenever user clicks on some custom button on child window, that window gets closed plus the parent page should be refreshed. But only child window is getting closed and parent ...
1
vote
2answers
172 views

Schedule Meeting for a Contact from Custom VF Page? Similar to Cloud Scheduler Functionality in Salesforce

Cloud scheduler in salesforce is used to schedule meetings for Contact, Leads or Account. Can the same functionality be achieved from Custom Visual force page. Either by invoking the same pop up ...