Questions tagged [scheduled-apex]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
27 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
27 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
17 views

Issue with Batch Apex Updating Results from AggregateResults SQOL Query

I have an object Referral__C where we add a NHC_Tracker_ID(Nhc_Tracker__C another object). I want to update the fields on NHC tracker by count Referrals and Unique addresses related to Referral. My ...
0
votes
1answer
36 views

Batch Class calling Future Method Error

I have below scheduelable class but issue is after executing this it is triggering another class and calling future method.. i need my that future to be called but needs to avoid that error. (one ...
1
vote
2answers
21 views

test class on scheduled job simply stalls out

Sometimes it will run and give the 'this job already exists' or it just hangs for hours until it eventually decides to work...right now it's been hanging for 14 hours in a test environment. Everywhere ...
0
votes
0answers
19 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
1answer
27 views

method not getting called inside rest api

I have created two rest API methods in the schedulable class when I called in the execute function my first method is called and worked fine in my First response my second method is not triggered. how ...
-1
votes
1answer
22 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
0answers
40 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: ...
0
votes
1answer
42 views

System.LimitException: Apex heap size too large: 9810745

I have a JSON too large to be deserialized, and I'm getting the Exception System.LimitException: Apex heap size too large: 9810745. I used ProjectClass= (ProjectClass) JSON.deserialize(jsonRequest, ...
-3
votes
1answer
43 views

Unable to cover test class for batch apex [closed]

I'm unable to run the test class for Batch apex. // This Schedule Class updates the Email Address of Inactive contacts whose Emp Termination date is over 30 days or Prac End date is Null global ...
1
vote
1answer
40 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
30 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
27 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
35 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
20 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 { ...
0
votes
2answers
37 views

How To Prevent creating Accounts In a specific month

I want to avoid Creation or Deletion of Accounts in a specific month(for eg December). How can I achieve this. Because the createdDate is null in before Insert and addError does not run in after ...
0
votes
1answer
36 views

CronTrigger.TimesTriggered is not incrementing after Test.stopTest() in Apex test class

I have a scenario in which an email is being sent to Users having admin profile at the end of the month for Closed Opportunities. Code seems to be working fine when tested in execute anonymous window ...
0
votes
1answer
52 views

Comparing Two Fields from Two Objects in Apex Scheduler

Whenever an account goes 18 months past the end date for the latest event that they have booked, we have code set up that will automatically change the account from being an active client to an in-...
1
vote
1answer
112 views

Email Alert from Scheduled Flow is Not sending

I have the following scheduled flow that calls all accounts and send an email alert. For some reason, none of the email alerts are being sent from the scheduled flow. We have been checking our spam ...
6
votes
2answers
105 views

How update Managed Packages (2GP) if one of the Apex classes is scheduled Apex

I often run into this error message: This schedulable class has jobs pending or in progress You can bypass this error by allowing deployments with Apex jobs in the Deployment Settings page in Setup. ...
0
votes
0answers
23 views

Setting batch size in a schedulable class run from dev console

I have the following schedulable class: global class OrderApprovalDeadlineScheduler implements Schedulable { private static BusinessHours bh; private static BusinessHours returnBusinessHours(...
2
votes
0answers
30 views

System.CalloutException: Callout loop not allowed when doing callout from Scheduled Flow

I am currently having an issue where my Callouts are returning an error: System.CalloutException: Callout loop not allowed The way the system works is this: I have a scheduled job that runs every ...
0
votes
2answers
25 views

Test unit for a scheduler

I have to develop a scheduler to process old registers of some object.. LastModifiedDate < LAST_N_DAYS:90 How can I create a test unit for such a scheduler? Is it possible to modify the ...
0
votes
1answer
109 views

Can one Schedule Apex Job run multiple times parallelly?

Scenario: I've created a Schedule Apex Job to run an 'X' class after every one hour. I will be running it through Developer Console using 'Anonymouse Execute Window'. The 'X' class inserts a large ...
0
votes
1answer
19 views

Exception: Invalid field for SObject Account

I have list which consists of field name. fieldList = new List<String>(); for(Schema.FieldSetMember memberObj : SObjectType.Account.FieldSets.rakch__DemoFieldSet.getFields()){ ...
0
votes
0answers
13 views

Testing schedulable apex class that sends an email [duplicate]

I am relatively new to Salesforce development (I'm an intern) and I am currently struggling with achieving 75% code coverage when testing a class that regularly sends out an email. I have included the ...
0
votes
0answers
20 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
16 views

How to write a test class for a scheduleable class that sends an email? [duplicate]

I am fairly new to apex testing and am completely lost on how I am supposed to test a schedulable class that regularly sends an email. The class that I have written is below. It is very simple, and ...
0
votes
1answer
13 views

exceptions and scheduled jobs

I know if there is an unhandled exception it will "roll back" any dml operations that occurred during the same transaction. Does this also include scheduled jobs? I'm not sure if scheduling ...
0
votes
1answer
29 views

How to update a Scheduled apex class in Production?

Will I have to deactivate the scheduled apex class in test, make the changes and push it to prod ? Is it as simple as it sounds or is there a catch?
7
votes
1answer
95 views

Scheduled Apex with one-time execution not being executed

We have a number of Scheduled Jobs that are scheduled with repeat and these are all working fine. We have a handful of Scheduled Jobs that are dynamically scheduled and re-scheduled, either as one-...
0
votes
0answers
18 views

How to make a test class for a scheduled apex class? [duplicate]

I am new to salesforce and I have written test classes for only one class before which worked just fine. But how do I write one for a simple scheduled apex class. Here is the code below: global class ...
0
votes
0answers
24 views

Calling a managed class (in vlocity) in a batch class APEX

Is it possible to make a batch class then call a managed class from the vlocity? I'm trying to do this but I don't have an idea how to start it since I couldn't see the parameters needed for that ...
0
votes
1answer
27 views

Issue with the last 15 min of the hour when running a scheduler to be execute after 15 min

We have a Campaign which has a field that counting available sits. When a user is filling it personal data within a form, and submit the page, he redirects to a payment site (other system). I want to ...
2
votes
0answers
64 views

Scheduling a Managed Package Class from Anonymous window getting Invalid Type Error

I have a "SchedulableClass" class in a managed package. I want to schedule the class to run for every 5 mins in my org by Anonymous block, Below is the code System.schedule('Schedule Job ...
0
votes
0answers
17 views

Schdulable class doesnt send emails on product org while same code works in test org

Im testing the code in Anonymous Window with this code: NotificationNameOptions abc = new NotificationNameOptions(); abc.execute(null); On production org I get this error: Line: 12, Column: 1 System....
0
votes
1answer
45 views

Test Class Coverage for Scheduled and Batch Classes

I am attempting to test a scheduled class that calls a batch class to update records. The following test class does not seem to find the Opportunity being created in the test class to pass that list ...
0
votes
0answers
23 views

Scheduling apex class through Processbuilder issue?

Hope all are doing good and safe. I have small issues with my class on scheduling through process builder.In my visualforce page I have a "apex:outputLink" by using this I'm executing some ...
0
votes
1answer
80 views

How to add 1 hour to record created date to run a Apex scheduler?

Hello All i am trying to run an Apex scheduler which i need to fire once if the DML fails in catch block. How to add 1 hour from the datetime where the exception is caught on the fly? catch(...
-1
votes
1answer
42 views

Difference between System.today() and System.today().day() in apex?

I have a schedule apex job that runs everyday in the morning at 2 AM, where I am trying to gather opportunities where custom date Reoffer_Date__c as today. List opportunitiesList = [ SELECT Id,...
0
votes
0answers
21 views

Dynamically Scheduling Apex to Run at Various Points in Time for different set of records [duplicate]

My use case is that our Salesforce org will do callout to external system at different times of the day. All these data are stored in a custom object, which basically stores the external system URL ...
3
votes
1answer
125 views

Is there a way to change deployment settings using sfdx or on scratch org creation?

The deployment settings (Setup > Deploy > Deployment Settings) contain a Boolean "Allow deployments of components when corresponding Apex jobs are pending or in progress" which ...
-2
votes
1answer
39 views

Is there any alternate ways to handle string in a better way in the below batch class. I feel it looks ugly? [closed]

global class batchFileUpdate implements Database.Batchable<sObject>{ global Database.QueryLocator start(Database.BatchableContext BC) { string reseller= 'RENEWAL_RESELLER'; ...
0
votes
0answers
19 views

IsAvailable returns false even when the user profile has Record types assigned

IsAvailable returns false even when the user profile has Record types assigned. Prototype of code below : List<Schema.RecordTypeInfo> rt = Case.SobjectType.getDescribe().getRecordTypeInfos(); ...
0
votes
1answer
42 views

How do I query on user object to pull out records that they are involved in 5 unrelated objects?

I'm new in Apex, I'm running a schedule apex to send out email notification to Assigned_Reviewer__c on Custom object called "Patient relations Review" if the record status is "In ...
0
votes
1answer
547 views

Schedule Apex Class — Error: You must select an Apex class that implements the Schedulable interface

Has anyone ever come across this error while attempting to schedule a Schedulable Apex Class? Error: You must select an Apex class that implements the Schedulable interface. I had previously been ...
0
votes
1answer
34 views

Scheduled Apex not firing

Still fumbling my way through this problem: Help understand Apex class / bulkilfy I decided to go ahead and create a query in Apex that gets the Leads I need to be reassigned and push those into the ...
0
votes
0answers
37 views

Apex Scheduler - CronTrigger gets created but doesn't run

We are running into an issue with the Apex Scheduler. We've scheduled some code to run every half hour. Since the ".schedule()" method only allow to run code hourly, we call the method twice ...
0
votes
1answer
36 views

Test class not covering my batch

I'm new to batch scripts. In my apex batch My start method will send records to execute method based on input given in custom label. I have created a test class and I'm not sure my execute method is ...

1
2 3 4 5
17