We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [scheduled-apex]

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

Filter by
Sorted by
Tagged with
-2
votes
2answers
33 views

How to call report in xlsx file format

could you please help me how to call report Xlsx file format, i am tried to below code, but i am not get the result: public class BatchUtilClass { @future(callout=true) public static void ...
0
votes
0answers
7 views

CPQ Generate Document Apex Jobs Queued Status

When clicking on "Generate Document" -> "Save" within a Quote record. The screen gets stuck loading. I did notice within Apex Jobs there is a lot of jobs Queued.
0
votes
1answer
43 views

I am not get the tabular report body in the attached email [closed]

I am not get the tabular report body in the attached email ,could you please help me. global class Exportertest implements Schedulable,Database.AllowsCallouts{ global void execute(...
0
votes
1answer
31 views

Upsert error with apex batch job

I have a custom object named AttendanceRate with 5 fields "AttendanceRate_' + weekDay + -'__c' for each day of the week. When a user creates an activity, he has 100% of attendanceRate for this day, ...
1
vote
0answers
13 views

Get the Schedules of Aborted Scheduled jobs

One of my team members has mistakenly aborted all the scheduled batch jobs from the system using the below code - List<CronTrigger> jobsToAbort = [select Id from CronTrigger where ...
0
votes
1answer
45 views

Code efficiency when using same content in multiple method in same class

what I should learn and do if I have 3 different methods that are essentially doing the same thing but only the query statement that makes the differences. For instance my code below have 2 methods ...
-2
votes
1answer
43 views

I am not able to scheduling the below code

When I am trying to schedule this below code: global class exportReport3 implements System.Schedulable { global void execute(SchedulableContext sc) { ApexPages.PageReference report = new ...
-1
votes
1answer
21 views

CRON Expressions every hour at specific times

Is it possible to run CRON job every hour at a specific time at that hour? I only ask because I want to spread out my scheduled batch classes throughout the hour to avoid maxing out the flex queue.
0
votes
1answer
33 views

calling two separate methods in an schedulable class based on time interval

I have One schedulable class that calls a method that have multiple if conditions to be executed FOR(Contact cont : contacts){ if(cont.Account....
1
vote
1answer
26 views

ApexLog's field DurationMilliseconds is giving large values for Schedule jobs

I was trying to debug a issue for scheduleable class, I found out that it is taking approx 65,00,00,000 milliseconds which is equal to approx 180 hours. But if I open that debug logs and see execution ...
1
vote
2answers
128 views

How many records can an Apex Batch process

Finding mixed results within web searches, trying to locate a concise answer as to how many records can a batch process. I am creating an apex batch that will run daily. It will query around 55,000 ...
0
votes
0answers
22 views

Test.setMock working in Scratch org but not in sandbox Org

We have batch class used to make an API callout and doing Opportunity upsert DML operation in the Start method. Based on the opportunity's return value, we are making another API callout and doing ...
2
votes
1answer
24 views

CronTrigger records already exist when running Apex test

I get the error message: Assertion Failed: Job already exist: Expected: 0, Actual: 3 When I run this test: @isTest public static void scheduleJob(){ // arrange // assert System....
2
votes
1answer
82 views

Add current stock price to account page

still pretty new salesforce developer, but I was curious what the best approach was to add a companies stock price to their account page in salesforce? I've been referring to the articles below: ...
0
votes
1answer
34 views

How to unit test the method that schedules an apex schedulable class

I have a method that executes the following code , I am not able to find any thing from CronTrigger to verify the scheduled job public static void ScheduleStatusChk(Id batchId, Set<Id> ...
1
vote
0answers
24 views

Scheduled import of leads

I have a requirement whereby leads are imported, but due to a process, they can only handle 5 leads every 10 minutes (inserting a lead triggers an inbound call to an agent). I have come up with the ...
0
votes
2answers
39 views

System.isScheduled() not working in Scheduler/Batch

I have a Scheduler class which executes a batch class. I also execute this batch class from a VF page. Deep down in the class hierarchy, I want to check if this batch was called from a Scheduler or a ...
0
votes
1answer
38 views

How to chain batch jobs when one is from a managed package

I have a scenario where users upload a file and a batch1 kicks off to create the records , once the records are created we pass on the ids we just created to another batch job (batch2) which is from a ...
0
votes
0answers
20 views

Schedule to the batch. By launching a single class (CRON creation) [duplicate]

I want to automation of the different steps by adding a schedule to the batch. By launching a single class (CRON creation). Setup the launch of the multiple phase throughout the time. Example: Phase ...
1
vote
2answers
40 views

Limit on Batch class

If I run a batch class every night, that goes over 10000 leads every night and updates a field. Would I get the limit exceeded error considering the huge number of records?
1
vote
1answer
47 views

I am trying to Schedule Class that will add a new contact under Account every 2 min

I am trying to Schedule Class that will add a new contact under All Account every 2 min and also there should be a validation check that you can not have more than 05 Contacts under a single Account. ...
4
votes
2answers
59 views

how to find out Schedulable class is already scheduled or not?

I have a apex class which implements Schedulable interface, I want to find out whether this class is already scheduled or not? Please help me with SOQL query to find out this.
0
votes
0answers
19 views

Time Trigger - Bulk process handling

I have a time based trigger (action on PB) which when met updates xyz field of account on last day of month. Suppose there were 300 records which initiated this time based Trigger on different ...
0
votes
1answer
37 views

Scheduling Flow

I am trying to create a screen flow that is scheduled in Salesforce. From the screen flow I call an Invocable method where I pass my input parameters from my screen flow. From there I call a future ...
0
votes
1answer
25 views

Schedule class runs instantly

I have a controller of an Apex Page from where I am calling a schedule apex class using system.schedule to run after one hour. From that schedule class, a batch class is being called to run which has ...
2
votes
1answer
23 views

Not Able to get fields from controller to Email Template when the mail is sent from scheulder

It would be great if I could get help with the below requirement that I have to achieve. The requirement is that I run a scheduler in a custom object called Project__c. Around 20+ projects pass the ...
2
votes
1answer
307 views

“Every 30 min” cron expression runs only hourly [duplicate]

I have a Lightning Component where users can choose how often an Apex Batch should be run. As options, I want to allow 30min, hourly and daily. Changing that should modify the CRON expression of a ...
2
votes
0answers
32 views

In a test class example of a Post Install script, sending an email and scheduling a class that performs an API callout

Scenario: In my example, as a part of the PostInstall (class implements InstallHandler) script I will be performing two actions; - sending an email to the installing User for the express purpose of ...
2
votes
2answers
101 views

Is system.schedule(…) @AuraEnabled?

I would like to know if system.scheduled is aura enabled or not. If not is there another methode that can replace it or a way to make it enabled? Edit final public class Plan { @AuraEnabled ...
1
vote
1answer
57 views

How to do this 'GET' through Batch?

I have a void callout class. But I need take all these tools through Batch to make it in Schedule later. How can I convert it into Batch structure with start, execute, finish? public static void ...
0
votes
2answers
46 views

unable to abort queued scheduled job

I have an apex job scheduled by mistake and now I cannot able to delete that. Due to that, I cannot able to edit my existing apex class. I tried the steps from Salesforce.com artice and when I execute ...
0
votes
0answers
70 views

How to make a Callout batch class?

I have a Callout with Lists and Maps. This takes objects from a resource and transfers them to my Lightning Component. How can I create Batch for this? I need Batch to schedule my callouts after every ...
0
votes
1answer
47 views

Schedulable error: You have uncommitted work pending. Please commit or rollback before calling out

I am trying to test Schedulable class which is designed to only run once. Because it's only runs once, I need to test that the System.abortJob is working correctly. I am using this code to test: ...
0
votes
1answer
49 views

Why my Batch is not updating the field

I am having one batch on Accounts which is not updating. I want to put the Sum of all the Normalized Accounts from all the invoices related to Accounts if the Status <> "invoice_canceled" and ...
1
vote
1answer
27 views

How to abort current scheduled job?

I would like to schedule a job to run once in 15 minutes time. According to this article: Run Scheduled Apex job once I need to add some code to the finish method: public void finish(Database....
0
votes
1answer
28 views

How many API calls can be made per hour to a non-bulk endpoint?

Assume that there was a REST endpoint that worked with 1 record at a time, i.e. not bulkified. If we were to use the Apex scheduler to pull down the records into SFDC every hour, what would be the ...
1
vote
1answer
48 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
34 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
235 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
102 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
20 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
65 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
38 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
296 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
18 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
102 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
22 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
104 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
102 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
90 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 ...