Specific to problems with writing, running, or testing Apex code, where code execution is initiated by scheduled Apex feature. This always includes a class that implements the Schedulable interface.

learn more… | top users | synonyms (1)

0
votes
2answers
51 views

System.EmailException: SendEmail failed in test class

I have a scheduler class for which i have written test class,when running the test class i am getting System.EmailException: SendEmail failed. First exception on row 0; first error: ...
0
votes
0answers
31 views

Class produces same result everyday using SOQL Today() function

I have a class that implements Schedulable...pulls in a list of records created today, by using the TODAY() function. The data should change, and when the SOQL query is run manually, I do get ...
-3
votes
0answers
35 views

How to write test class for a scheduled class that sends montly emails? [closed]

public class sendEmailsToVolunteers { public static void sendEmails() { EmailTemplate templateId = [Select id from EmailTemplate where name = ...
0
votes
0answers
23 views

send email alert to opportunity owner when opportunities closed date has passed

I want to send email alerts to opportunity owners when their opportunity close date passed. Let say if an opportunity owner have 4 opportunities with same close date so only one email alert should ...
0
votes
2answers
26 views

abort currently running job in Salesforce

Is there a way to abort currently running batch job in Salesforce? I tried to run the query below and all it did was remove all jobs from Scheduled Jobs section without stopping the one that is ...
0
votes
1answer
30 views

Scheduled Apex Class Testing Issue

I am trying to test a scheduled class in apex, but upon running the test method it gives me the following error: System.JSONException: Unexpected character ('0' (code 48)): was expecting ...
1
vote
2answers
38 views

Batch Apex Query - when multiple batch jobs fails

Just a quick query on Batch Apex. Let us say I have about 8000 Opportunity records to process in our nightly batch job. The objective of this batch is to update a field on Opportunity if it matches ...
1
vote
1answer
18 views

Mass Email Alert to Salesforce Users

We have a requirement to alert the opportunity owner 90 days after the opportunity was created and meeting certain data criteria. We need to issue this alert on a daily basis for all matching ...
-1
votes
1answer
30 views

Cron Schedule Mondays 6AM

How can I schedule this batch class to run on every Monday at 6AM? public class BatchCount implements Database.Batchable<SObject> { public Database.QueryLocator ...
15
votes
2answers
773 views

How to run Apex code every 5 minutes in 2016?

From a naive read of these questions and answers: 2012 - Are there best practices to get scheduled apex scheduled to run faster than once per hour? 2013 - What will be the cron expression for ...
3
votes
1answer
249 views

Need assistance on scheduled jobs

I have a scheduled job in my org which was scheduled 2 years ago without an end date. It runs every Friday at a specific time, which means it was scheduled using a cron expression. If I delete that ...
0
votes
1answer
46 views

Schedulable Batch Apex - Create Tasks

I'm looking to run a scheduled apex batch class that will create a task on any Contact record that had a sales rep assigned to them 1 day ago that hasn't been emailed yet. I've created 2 custom ...
1
vote
0answers
18 views

Can we send the follow up emails on the already send system email?

I have a requirement, as per which the system sends an email notification in each quarter to the Account contact for some document submission. Now, the system has to send a follow email after every 7 ...
5
votes
2answers
68 views

Scheduled Apex Class - Too many DML rows: 10001

I'm trying to schedule an apex class to run once every month to reset a number field on all Accounts to 0. global class updateMonthlyActivityCount Implements Schedulable{ public list<Account> ...
1
vote
1answer
36 views

Replicate Time Dependent / Scheduled Action Using Apex Code

I need to send an email to Contact(s) listed in my Opportunity Contact Roles, 24 hours after an Opportunity has been Closed/Lost, if the Opportunity hasn't been reopened in the meantime. So ...
0
votes
0answers
19 views

Batch is scheduled but cannot see any run logs in 'Apex Jobs'

I have a batch scheduled as can be seen in ‘Scheduled Jobs’ but somehow I am not able to see the logs in ‘Apex Jobs’ table. Therefore , I am not able to understand if the batch runs or not. I have ...
0
votes
1answer
28 views

How to schedule a job as specific user

In my requirement i have to send the custom report developed by us through email. So i have created apex scheduler class,email template and visualforce component. But when i schedule the job...there ...
0
votes
0answers
25 views

Apex Scheduler Help

I wish to write an apex class that runs 30 days after a status has been changed to Resolved this should change status field from Resolved to Closed. The reason for not using a workflow rule is ...
0
votes
1answer
26 views

Apex Class Scheduler for email template

I am turning to the forum for guidance and assistance. I have been trying to figure out a a means to schedule a email to fire to for a Contact on an Account that has not submitted their Monthly ...
0
votes
0answers
19 views

Schedule Apex class code coverage at 0%

I have been working on this yesterday. I am still new to developing APEX code so go easy on me. I just need someone to point out where I am going wrong. I am attempting to create a trigger (new task ...
1
vote
1answer
36 views

How to send one email with multiple records in it

I wrote the schedule class for sending an email with lead records(It's going mail with each record) but we need to send one email(based on state) with multiple records created in lead(based on state). ...
2
votes
1answer
32 views

How To Change Apex Class into a Scheduable Apex Class

I am still a beginner and I trying to create a trigger that will create a task on a weekly basis (task once a week) until a field in the opportunity is label complete. This Trigger and Class work, as ...
4
votes
2answers
76 views

Testing scheduled apex: CronTrigger does NOT fire after Test.stopTest()

EDIT for clarification of title: CronTrigger is probably actually firing at some point in the testing process - what is wierd is that CronTrigger.TimesTriggered is NOT incrementing after ...
0
votes
0answers
12 views

How to find Process builder modified scheduled actions

I have one Time based workflow for one custom object. When i change the schedule date, the time based workflow is showing updated scheduled date as showing in these pictures This is actual date: ...
1
vote
2answers
72 views

Passing an ID into execute method in Scheduled Class

Issue is under execute method, we have a sendMailDistribution(Ids) method, here am unable to get ID. It's giving an error like NullPointerException, am unable to rectify this. Can you please help me? ...
1
vote
0answers
28 views

Get the number of Opportunities for each User in the org (the count must include the records to which the User has atleast read access)

I need to get the count of Opportunity record for every User in the org where the User has atleast read access on the Opportunity record. I need to store the data obtained per User for every month in ...
1
vote
3answers
28 views

How to Re-Create Scheduled Jobs After Deleting Them

I need to make some changes to a schedulable class that inserts Case Share objects for our custom permissioning model. When trying to make changes to the class, the error is thrown that the class has ...
0
votes
1answer
40 views

Which Scheduled Job will run first?

I have two different Apex Jobs scheduled at 12:00 AM as shown below: Which job will run on next day? Will both jobs run one after another or only one job will run on next day? Both jobs refer to ...
0
votes
1answer
40 views

Cover Test Class with ContainsKey and KeySet Map Method

How do i cover containskey() and keyset() method? i only cover 68% of my code. here's my class here's my test class @isTest private class testCheckPickedLead{ static testMethod void ...
0
votes
1answer
30 views

How Process builder schedule actions works

I have few schedule actions of Process Builder. The process is going to fire based on one Boolean record when that made true. I scheduled 100 days before expiry date. Now if i want change expiry date ...
2
votes
1answer
59 views

Batch Apex vs Regular Apex

We have a nightly job that will update opportunities for every record in a custom object. Since that custom object will contain only the "updates in the last 24 hrs", we do not expect the volume to ...
3
votes
1answer
33 views

Error in schedulable test class

Can any one help me out in writing the test class for the Schedualble class.I have written a test class but the system throws an error : Error: Compile Error: This schedulable class has jobs pending ...
2
votes
2answers
45 views

Possible to create a workflow to check field criteria after X time?

Requirements: I have a custom object with a boolean field that will always be set to false on creation. Within a given time interval, that field could be changed to true. When the time interval is ...
0
votes
1answer
62 views

Query Activities on Lead

i need to query activities on lead. the idea is i want to get which lead has 10 activities with "unreach" subject and automatically change it to unqualified. i will use scheduled apex to daily check ...
1
vote
1answer
18 views

Execute queue in certain hours only

How can I modify this class to execute only within office hours? public with sharing class AddLeadQueue { public void AddLeadQueue() { System.debug('loaded'); } @future (callout ...
3
votes
1answer
45 views

Is there any way to schedule dashboard refresh at schedule time [duplicate]

I am trying to implement a process which can help me in refreshing the dashboard after one hour. I have tried using salesforce process builder but that too depends on having an activity.Please do ...
4
votes
3answers
155 views

Invalid field when using template, even though the field isn't set by me

I have an Apex class that runs every ten minutes and sends emails for some opportunities that were created in the system. Or at least, that is how it should work, but I'm getting an ...
2
votes
2answers
39 views

Email reminders per week

Please tell me the which aspect of salesforce should I use to implement this: I need to send reminder to the owner of a record as the end date of that record is nearing. I need to send one email per ...
2
votes
3answers
71 views

Both Apex Flex Queue and Scheduled Jobs used up

The system has batch call out APEX classes to sync Salesforce information with another Email sending provider, Active Campaign. Every time we insert or update a custom lead or custom opportunity, the ...
1
vote
1answer
27 views

testing future with callout from schedulable class

I'm definitely missing something. How do I test Schedulable class with a future method that does a callout?I have 100% code coverage of the Schedulable class but 0% of my service.The test fails as no ...
1
vote
1answer
115 views

Sending an VF Template Using Apex

I am trying to send an VF Template using the Schedular Apex. when i run the code below is the error message received: FATAL_ERROR System.EmailException: SendEmail failed. First exception on row ...
0
votes
0answers
118 views

INSUFFICIENT_ACCESS_OR_READONLY error when sending email from scheduled class

I have a batch job that send emails on user anniversaries. It works when I run it in the execute anonymous window from SF's developer window. I'm sending it through the org-wide email address and I've ...
1
vote
1answer
40 views

Issue with Schedulable implementation and Callout

I am receiving an error message when trying to test a class that implements Schedulable. System.CalloutException: Callout from scheduled Apex not supported. People have suggested using the @future ...
1
vote
2answers
105 views

Process Builder vs Scheduled Apex

I have the following requirement. Update the date field for a specific set of opportunities every day. My first thought process is to build a batch/scheduled apex solution and schedule it to run ...
0
votes
1answer
40 views

Too many DML rows: 10001(bulk update)

I am getting an error of Too many DML rows: 10001 on my batch class.I am putting up the code here consisting of both my scheduler class and batch class which is called through it. Scheduler Class :- ...
0
votes
0answers
10 views

Partial updation/creation/deletion of records in Visual Flows are possible?

I am wondering and did not found any article on this as we all know, DML database methods allows partial success of a bulk DML operation if a record fails, the remaining of the DML operation on ...
1
vote
1answer
67 views

Update latitude and longitude through batch apex

When i run my batch apex latitude and longitude are not getting updated in customer object. i need to update 50000 record.. getting lat and long using google API i able to request 2500 record per IP. ...
1
vote
0answers
22 views

what does mean each digit in system.schedule

I just want to know what each digit means in (String CRON_EXP = '0 0 * * * ?'; ) AND Can you explain what does meaning for below lines. System.schedule('Hourly', '0 0 * * * ?', new MyHourlySchedule() ...
-1
votes
1answer
34 views

2 Separate batchable jobs or 1 combined one? [closed]

I have a batch job which runs overnight, which currently only uses the Opportunity object. I now have a need to run the same process for the Order object. How would I do that - do I need to create 2 ...
0
votes
1answer
23 views

Need to cover Else if part in test class

I covered 1st six condition but after that i am not able to increase my code coverage.Plz help. Apex class: if(acc1.Domain_Name_Number__c == 0 && acc1.Subscription_Age__c == 7 && ...