Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [scheduled-apex]

Issues with writing, running, or testing scheduled Apex code, using the Schedulable interface.

1
vote
1answer
21 views

Schedule Batch Apex too many rows

I am having an issue because I believe I don't understand batch apex/scheduling very well. Every time I use this I get either a SOQL error of trying to query too many rows of 50001, or a DML error ...
0
votes
1answer
28 views

Schedule class from the CronTrigger?

I have a requirement where I need give user an option to schedule a batch in a custom lightning configuration page. I can able to do it when we create a single schedule for a particular Batch by using ...
2
votes
1answer
50 views

System.StringException: Unexpected end of expression

Error: Line: 3, Column: 1 System.StringException: Unexpected end of expression. Class: public class OppSchedule implements schedulable{ public void execute(SchedulableContext sc){ ...
3
votes
1answer
45 views

How should I schedule multiple job of the same class?

I need to have a job that runs every 15 minutes. I checked out the documentation for Apex Scheduler and I came up with two solutions: 1-st: ScheduledJob job = new ScheduledJob(); System.schedule('...
0
votes
1answer
18 views

Can we run Scheduler class through another org?

I have a issue ,I have a source org and a target org ,i run a scheduler class from source org and it send data to taget org .Now i want to reschedule source org Scheduler class from target org . How ...
1
vote
1answer
26 views

How to find accidentally deleted scheduled apex job?

I cant find it anywhere even recycle bin, can someone help me how to find deleted scheduled job in salesforce?
0
votes
0answers
36 views

Schedule class doesnt work [duplicate]

Im having problems creating a schedule job in SalesForce. i have this class: global class dollarGetSC implements Schedulable { global void execute(SchedulableContext sc) { dollarGet....
4
votes
1answer
114 views

Enqueue Queueable class multiple times

I need to do five different callouts from my trigger. I'm planning to use one Queueable class for all the callout using the parameter passed in the constructor. I'm not sure if it is possible, if it ...
0
votes
0answers
13 views

Campaign Data from Salesforce to Eloqua

I am looking to send campaign data from Salesforce to Eloqua. I am just not sure what the best approach is or if there is anything built in that can help me do this. If not would the only way be to ...
2
votes
1answer
38 views

Get the actual Previous Fire Time of a CronTrigger / Scheduled Apex

I am exeuting Scheduled Apex that should do processing based on the last execution time of the particular code. I query some records for processing and I only want to query those records, that have ...
0
votes
1answer
14 views

how to get details of deleted scheduled apex job. need exact cron query

we had a an old scheduled apex job running every 7 hours setup by a consultant. we deleted the job. we know the apex class that it used to call but we do not currently know the exact cron query or job ...
2
votes
1answer
90 views

Validation rule Scheduled Apex

I have a scheduled apex job which updates a field which is controlled by a validation rule as follows: AND( Not(ISNEW()), $Profile.Name != "System Administrator", ISCHANGED(...
1
vote
0answers
39 views

How to bulk query ContentDocumentLink for Scheduled Job

I have a trigger that fires on the ContentDocumentLink object that then calls a REST Webservice. The logic basically places a users document into our Document Management System from Salesforce and ...
5
votes
2answers
65 views

How to disable asynchronous jobs so that they cannot update data

There will be a data export happening from our org for large number of objects and records using a cloud based ETL tool. We have a business scenario where we need to make sure that there is no data ...
0
votes
1answer
31 views

How to See Scheduled Job Run History

I have a scheduled job that is supposed to run every night at midnight. Recently users have said that the job didn't run; however this is sporadic, some nights it works and others it doesn't. Is ...
1
vote
1answer
36 views

How to manage versions of scheduled flows?

We have an autolaunched flow that we would like to run on a schedule. I have created an apex class to do so, but when testing the class, I discovered that it is encountering errors only associated ...
0
votes
1answer
58 views

Schedule a Queueable class

i am quite new to salesforce so i am not sure about this, and i wanted to get a clear answer since i haven't found one yet. Can i schedule a Queueable class that basically makes a callout to get and ...
1
vote
3answers
68 views

Need help-apex cpu time limit exceeded

I scheduled an apex job to run daily at midnight but noticed that the job failed due to the Apex CPU time limit exceeded error. The code works in my developer sandbox but not in production. I'm ...
1
vote
1answer
63 views

How to get CronTrigger ID of Scheduled Apex job when starting the Scheduler

I recently created a scheduled Apex job in a sandbox, then later tried to abort it and was unable to because I didn't have the CronTrigger ID and couldn't find it. I found several questions on ...
0
votes
1answer
18 views

Create a task if a particular if a date lapses? Scheduled APEX the only option?

I feel like I may be missing something obvious here, but I have a certain field that is populated with a future date. I would like to ensure that follow-up tasks are created when that due date lapses, ...
0
votes
1answer
16 views

Who is the sender for a SimpleEmailMessage sent inside an scheduled apex class?

If I have a scheduled job that periodically runs and queries a custom object, then creates a simpleEmailMessage and uses Messaging.sendEmail(), who will the sender for that email be? The user who ...
0
votes
0answers
72 views

Create Excel XLS from batch apex via Visualforce page

I have a scheduled batch apex that currently creates a .CSV document and attaches it to an email, but I have to change it, so instead of a .CSV file, I get a formatted XLS Excel document. Now, after ...
0
votes
0answers
11 views

Apex scheduler failing to execute scheduled job [duplicate]

I have an Apex Class an example below. global class EmailChasing implements Schedulable { global static void execute(SchedulableContext SC) { chaseEmail(); } public void chaseEmail(){} } Error ...
0
votes
1answer
45 views

Test classes for Scheduled Apex classes [duplicate]

Below I have shared the APEX code and the Test class code. I receive 100% code coverage, but I cannot grasp certain parts of it. Eg. The system.assert function - is it necessary? How do I know my test ...
0
votes
1answer
42 views

Batch and Schedulable Help

I'm trying to create a batch class that updates a set of number fields based on a particular profile that edits them and a schedule class that updates those changes every night at midnight. So far ...
0
votes
2answers
56 views

how to schedule a salesforce job every 3 months? [duplicate]

Someone know how to cron a salesforce job every 3 months, on the 1st at 9am? any ideas?
0
votes
1answer
33 views

Need help with Apex Batch job

I need to: Implement a batch job to Delete records that are past 60 days. Use helper class to implement the logic for deletion. Use the wrapper class in helper class to return the DML results to ...
0
votes
0answers
36 views

Trigger to fire after 10 seconds only ONCE

I have a use case where I need to do an Aggregate SOQL on OpportunityLineItem(oli) & its opportunitylineitemschedules(olischedules). I have 2 triggers(Trigger1 on Opportunity & 1 on oli). On ...
0
votes
1answer
20 views

Why my private static Map is empty on execute when it is filled in the constructor in apex batch class?

In the following code: global class MyBatch implements Database.Batchable<sObject> { ... private static Map<String, Id> mailTemplates = new Map<String, Id>(); ...
0
votes
1answer
31 views

Help with batch/scheduled apex

I'm trying to figure out the best way to transfer Account ownership of certain accounts once a day. I would use declarative tools but can't because the data that would fire the automation is coming ...
0
votes
1answer
15 views

Can i run 200 schedule with in 1 hour range with different name?

Based on the below link, I am aware that we can schedule the job upto 100 per hour. Can i schedule more than 100 job with different name. JobName1 - 20 JObName2 - 80 JobName3 - 80 - what happens ...
3
votes
1answer
43 views

Which scheduled jobs count towards the max concurrent scheduled jobs limit?

Per the docs we can only have 100 scheduled apex jobs at any one time in most orgs (5 in dev orgs). Which jobs count towards those limits? Would the following query return the right number? SELECT ...
-3
votes
1answer
37 views

System.QueryException: unexpected token: nullnull

I am doing a query from a field in custom settings. And updating the leads Here is my apex code public with sharing class textInputsConsecond implements Schedulable { public list<Lead> ...
1
vote
1answer
78 views

Invalid type for implements System.Schedulable Class [closed]

I have the following class which I try to schedule from the anonymous window but this gives the error: invalid type:abc_RiskSchedulerProcessor Class global class abc_RiskSchedulerProcessor ...
0
votes
0answers
26 views

Daily emails based on date field in Account object (Apex Class) - help?

I'm trying to create an Apex Class that checks all Account records on a daily basis and sends an email to the email field on ones that have a review due on that date. For example: Vendor ABC Pty Ltd ...
-1
votes
1answer
27 views

In apex how to know the whether a batch is schedule or it's running?

I want to know the status of a batch like whether it is schedule or it's running
0
votes
1answer
10 views

Scheduled Apex - Check if record meets criteria of latest date on a child record

I'd like to create Scheduled Apex to run overnight. The requirement is to remove sensitive information from a Contact if they have finished attending any courses they are booked onto (i.e. the ...
0
votes
1answer
59 views

Schedules Apex Failing - Attempt to de-reference a null object

I am getting the following error for a Scheduled Apex Job and don't know how to fix it (not a developer, just adapting some existing code). The aim is to update a field every night to trigger ...
0
votes
2answers
53 views

notify user by sending an email to user whose last-login is more than 1 day

Here is my code, please check global class LastLoginEmail implements Schedulable { global void execute(SchedulableContext SC) { List<User> uds =[SELECT Id, LastLoginDate, Email FROM ...
1
vote
2answers
82 views

Schedule apex class to run every year

I need the apex class to be scheduled at 1st January 12:00 AM every year how to achieve it? global class autoCreateIS implements Schedulable { global void execute(SchedulableContext arc) { ...
0
votes
1answer
30 views

Scheduled Job occassionally does not reschedule for next run

I haver a scheduled job that runs every fifteen minutes. It runs fine for several months and then randomly it will stop running and doesn't reschedule for the next run. The apex jobs showed an "...
2
votes
1answer
37 views

Schedule Apex to Update Leads based on Tasks

Problem: I have two fields on my lead object that I need to back fill information into. These fields are filled by looking through each of tasks off the lead; grabbing date/times off these records ...
1
vote
1answer
60 views

Is it possible to call a future static callout method from a scheduler

I have a static callout which i want to schedule every 5 minutes. How would i approach this I have tried the following but the the incorrect signature error: Callout public class or_service { @...
0
votes
3answers
52 views

Executing system.schedule scheduled class (Method does not exist or incorrect signature)

I'm trying to write a scheduler Apex class to create an Accounting Period every month and am getting an error when compiling Method does not exist or incorrect signature: void schedule(String, ...
1
vote
2answers
87 views

Query Limit on Batchable Class

What is the best practice with governor limits with Batchable classes and queries inside of the Batchable class? I am running into query limits with a Batchable class because I have too many ...
0
votes
0answers
186 views

Schedule apex class to run every day

I want to make some rollups on a custom objects via a scheduled Apex class. I managed to test the rollup via an Apex trigger, which fired whenever I edited the custom object. Now I want to run it ...
0
votes
2answers
93 views

Calling Batch Class from Scheduler Class for Multipe batches [closed]

I have a batch Class and Schedular Class. I am calling Batch class From Schedular class Multiple Time in Execute method.Is this a good practice? In Batch class i am doing callout and insert/update ...
0
votes
1answer
31 views

Unable to get the non duplicate Contact Emails from Child records

I have a lookup relationship between Order Line and Contact Objects where Contact is the parent. I am writing a batch class which looks for certain criteria on Order Line and send email to Contacts ...
0
votes
1answer
151 views

Why the Manage button in Scheduled Jobs is not visible

I scheduled 2 jobs in Developer Console: System.schedule('Scheduled Process Daily at 09:00 and 21:00', '0 0 9/12 * * ? *', new ScheduledProcess_1()); System.schedule('Scheduled Process Daily at 03:00'...
0
votes
1answer
63 views

Batch Scheduler Error

I have Created a batch scheduler which need to run for Every 5 min. but i am getting this error. can any one please help me out. Error: Compile Error: Method does not exist or incorrect signature: ...