Questions tagged [schedulebatch]

Class than can be scheduled to run at a certain time and invoke a batchable class

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

How to catch exception if flexQueue is full when using System.scheduleBatch

What happens to a batch class which is scheduled to be executed by System.scheduleBatch(batchableClass, batchClassName, 1, 50); The batch class gets scheduled as a Schedulable Job after a minute. ...
-1
votes
0answers
11 views

how to send an email in every 48 hours to approver that he/she has pending this much bulk of request to approve/reject [closed]

Requirement is need to send an email in every 48 hours to approver that he or she has pending this much bulk of request to approve or reject of new opportunity using existing approval process.so what ...
0
votes
1answer
32 views

Not getting enough test coverage for schedulable batchable class

I'm updating some code written by another developer, and I'm having a problem getting adequate code coverage for the batchable, schedulable class. None of the test methods call execute(Database....
0
votes
1answer
64 views

Is it possible to schedule a class every 14 days?

I am trying to schedule a class every 14 days based on a start date. Example: I want the scheduled job to run on 1st Tuesday of the month and 14 days off that i.e. 3rd Tuesday and then a 5th Tuesday ...
0
votes
1answer
49 views

Multiple Emails via Apex Batch instead of one

We have a Batch Apex that loops over 9 Custom objects and sends out one email to each user who are assigned in any one of the custom object. This should send out one email to each even though if they ...
0
votes
1answer
37 views

Insert record in related child object only if size of related object is 0

I am trying to insert record in related child object but only if size of related object (Comment__c) is 0. Means there should be no records in relate child object. I have done the implementation but ...
0
votes
2answers
26 views

How to control the number of records per run [closed]

I would like to know the best way for me to insert X amounts of records at a time. For example: Suppose I want to enter a list of 50000 records. In order not to run into problems, I thought of ...
1
vote
1answer
35 views

How to Send email to multiple user from batch apex

I am trying to create a batch that will run every day and will find the contacts which match the criteria. at the moment the code I have written is sending email to the same email address (time the ...
1
vote
2answers
123 views

Order of constructor execution for a class that implements a batchable as well as scheduleable interface

I am writing a batch class which should be scheduled to run at a certain frequency. I am putting both interfaces on same class - global with sharing class testbatch implements Database.Batchable<...
0
votes
1answer
17 views

Suppose I schedule a Schedulable batch job and my profile is “API User” and then it upserts

Suppose I schedule a Schedulable batch job and my profile is "API User" and then it upserts and a trigger runs to insert/update records. In whose context it will run? Who will show as "...
0
votes
1answer
76 views

Schedule triggered flow not running for all Resources

I have a schedule triggered flow that runs weekly on the Resource object. I have a custom setting checkbox which I use to denote whether the flow should run that week or not(bi-weekly pay schedule). ...
4
votes
1answer
201 views

executeBatch method returning invalid id 000000000000000

One of our client is seeing this issue in their production org. Following is the line where this issue is occuring : ID batchId = Database.executeBatch(MainBatch); This line is throwing System....
0
votes
1answer
36 views

Catch error in scheduled batch

I want to catch here an error on deleting records. but i dont really understand how? Can u help me please? public with sharing class AccountTest implements Database.Batchable<SObject> { ...
0
votes
0answers
16 views

Authsession values not coming in scheduled batch job

List<AuthSession> lstAuthSession = new List<AuthSession>(); lstAuthSession = [SELECT Id, SessionType, UsersId, UserType, NumSecondsValid, IsCurrent, ParentId, LastModifiedDate FROM ...
1
vote
0answers
47 views

Insert Big Object in Batch Class

I am trying to create records in a Big Object using a Batch class. However, when executing the Database.InsertImmediate() command, the error below occurs: Just as a note, the Database.InsertAsync() ...
0
votes
0answers
32 views

Execute batch from trigger if number of records in Trigger exceeds 10000?

Since we can't update more than 10,000 records in trigger in real time I was thinking of automating the update of the remaining records through a batch called from a trigger. So, Let's say for ...
0
votes
1answer
49 views

Is there ANY WAY to SCHEDULE this CODE?

private static void scheduleTEst(Set<Id> sObjectId, String cronJobDetailName, String className, Integer hour) { List<CronTrigger> scheduledExecs = [SELECT Id, CronJobDetail....
0
votes
1answer
27 views

4 Schedule Statements using scheduler vs scheduling a batch from finish method for every 15 mins

I want to schedule a job every 15 mins, for now I have created a scheduler class and using 4 statements to schedule it, but then again there is no guarantee that a job might complete itself in 15 mins ...
0
votes
1answer
19 views

schedule job using cron expression

How we can execute/schedule job every month's first week of saturday using cron expression. 0 0 13 * * ?
0
votes
1answer
21 views

A callout in the for loop of a batch class's execute method is causing: You have uncommitted work pending

I have a scheduled batch, that takes all cases with field isFailed__c true in the start method: global class UpdateCases implements Database.Batchable<sObject>, Schedulable, Database....
0
votes
2answers
42 views

Hourly Batch job not running as expected

We want to run a Batch job that runs hourly and updates the users to Inactive if they are logged in last 2 Hours but not 30 Minutes. The Code works fine when I run it manually and but i need to run ...
1
vote
1answer
72 views

System.SObjectException: ORA-20001 when deploying Changeset for users

I'm deploying an apex class and Test class which is running successfully and covering 84% test coverage in sandbox however when deploying it in Prod, I'm running in to below issue. I have included ...
0
votes
1answer
54 views

System.SerializationException: Unable to load class:

I have a scheduled class for which I'm getting this error. Apex script unhandled exception by user/organization: 0052i000001fdsd/00D2i0000003dds Source organization: 00D46000000ttrg (null) Scheduled ...
0
votes
1answer
26 views

SOQL to Pull LastLoginDate from past 2 hours but not last 30 minutes

Here is the scenario that I'm running in to. I need to able to pull users that logged in past 2 hours but not last 30 Minutes. I tried every possible way to filter this in but since we can't Use ...
0
votes
1answer
31 views

Running in to error First error: line 1:74 no viable alternative at character '"'

I'm trying to run a batch that makes user Inactive if logged in past 2 hours. It runs in to error ": line 1:74 no viable alternative at character" when i try to run this batch. I doubt if ...
0
votes
1answer
113 views

How to query records processed between last batch job if I'm running batch class five times a day

I want to process only those records in my batch job which are updated since the last time my batch job ran. Basically, I'm running my batch job five times a day and want to process only those records ...
0
votes
0answers
37 views

Query in Batchable class not working

So We have a Batchable class that calls another apex class which used to send the renewal link for all the contracts of a particular account type. It was working perfectly fine but now we are seeing ...
1
vote
1answer
21 views

Log indicates I am going over Query row limit but only pulling 153

I was hoping someone could give me some insight on why this is failing. I think it's because the Master Inventory Object is over 300 thousand records but the thing is I'm never querying even close to ...
0
votes
0answers
31 views

Delete a schedule Job that execute a batch job after the batch is finish

We want to execute a schedule job after a change occurs in one of ours custom objects. The Idea is to execute a batch after 10 min with all the changes that occurred on that time period. For that we ...
0
votes
2answers
43 views

Next Scheduled Run empty when using System.scheduleBatch in managed package

I'm trying to debug this recent issue. Code works fine in scratch orgs, but when ran in managed package scheduleBatch seems to never execute. I wonder if there's some throttling going on as we use ...
-1
votes
1answer
37 views

Dynamic Variable Scheduler Class

I'm looking to pass a variable to my scheulder class when scheduling a batch job. The idea is that I'm scheduling the class multiple times, but passing in a different variable each time. Example: ...
0
votes
1answer
24 views

Batch Apex Error - Class must implement the following methods System.ScheduleableContext)

I am trying to update a batch class to allow me to schedule it, but I am getting this error: Class must implement the following methods System.ScheduleableContext I understand the error, but given my ...
0
votes
0answers
190 views

Getting error in scheduled flow

Hi I have created a scheduled flow which will be fired before 30 days of expiration date on lead. But I am getting following error. SObjectRowId ={!$Flow.CurrentRecord} (null) Info Error Occurred: ...
1
vote
1answer
45 views

Do I have to implement the schedulable interface even if I only need it to run once and schedule a daily job?

I feel like i'm missing something basic here, I wrote a batch class that should be scheduled to run daily at a certain time of the day, forever. Do I really have to create an additional class that ...
0
votes
1answer
32 views

Scheduled end date in a custom report

I have custom report for scheduled batches i need fields included in the report Start date and END DATE of the scheduled jobs. I have checked these objects AsyncApexJob,CronTrigger,CronJobDetail but ...
0
votes
1answer
30 views

will the schedulable apex exceed if I run several call out functions in it?

for example, a schedulable that run two call-out functions like: global class scheduletest implements Schedulable { global void execute(SchedulableContext sc) { callOutFunction(a); ...
0
votes
1answer
40 views

Is it possible schedule an apex job to run several times everyday but during an interval time? [closed]

I am quite confused about the CRON expressions. I would like to run a job several times every day but in a time interval. For example: Every day run X job every 2 minutes from 3:00 am to 4:00 am. If ...
0
votes
0answers
22 views

Future method cannot be called from a future or batch method on Scheduled job

I have found this issue when trying to do a callout from an scheduled job and I can't get it to work properly. Schedule class: global class TM_LATAMCargaModeladoSchedulable implements Schedulable { ...
1
vote
1answer
50 views

Test Class Id Error

I trying to get better and have built a trigger/test class using my knowledge I have learned however I am running into an error with the test class that for some reason I just cannot resolve and ...
0
votes
1answer
57 views

Encountering Constructor not defined in test class

I'm scheduling a batchable class that deletes records from a custom object. The test class for my scheduled class saves without errors. However, I'm getting a "Constructor not defined: [...
0
votes
0answers
28 views

Schdeuled Batch Job Duration

I had 2 different scheduled batch classes that ran on 2 different custom objects, but both were designed to update their respective related Account records. I was running into an error that one of ...
1
vote
1answer
75 views

Testclass Schedule Batch Error - No more than one executeBatch can be called from within a test method. Unable to cover

I have Schedulable, Batch class public class Schedule_Batch_CheckUser implements Schedulable ,database.Batchable<sObject>,Database.AllowsCallouts, Database.Stateful{ public void execute(...
0
votes
1answer
23 views

Scheduled Batch Errors

I have 2 batch apex classes, each with a scheduler class. I am trying to run them sequentially but I am getting 2 errors on the 2nd batch class in my logs: Error #1: FATAL_ERROR|System.StringException:...
0
votes
1answer
55 views

Scheduled Batch Apex Sequentially Error

I have 2 batch Apex classes that I am trying to run sequentially. I updated my classes based on a post I saw using a custom setting (BatchSchedule) with 1 field (Scheduled_Id__c) that is et to 0. ...
0
votes
1answer
44 views

Error with Scheduled Batch Classes

I have 2 batch Apex classes that update Account fields from different custom objects. I was running into issues of accessing records and found a way to run the batches in order. The test class for my ...
0
votes
1answer
32 views

Error in Test Class for Scheduled Batch Apex

I have 2 batch Apex classes that update Account fields from different custom objects. I was running into issues of accessing records and found a way to run the batches in order. The test class for my ...
0
votes
0answers
32 views

Apex batch not committing records in production but executing without errors. Also working fine in sandbox

I have an apex batch which i tested in sandbox and it is working as expected but in production it is executing without error but not committing the records. I executed the same batch code in anonymous ...
0
votes
0answers
34 views

Covered problem for Schedule class [duplicate]

Maybe somebody has an idea why the test method doesn't cover. Uncovered method - global void execute(Database.BatchableContext BC, List<Growtivity_CM__Zorgovereenkomst_Product__c> scope) { ...
0
votes
1answer
79 views

Apex Job Execution - Multiple @future Methods in the Same Transaction

Could you please help me with the below queries related to Apex Job Execution: If multiple Async request(future methods) are fired in the same thread, it makes the Async job request status as Queued ...
0
votes
1answer
905 views

System.UnexpectedException: Start did not return a valid iterable object

I am trying to write a test method for my batch class so I can deploy it, but I am getting this error. System.UnexpectedException: Start did not return a valid iterable object. The batch class looks ...

1
2 3 4 5
9