Stack Exchange Network

Stack Exchange network consists of 174 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 [schedulebatch]

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

0
votes
1answer
16 views

Email not been sent from the finish method of a batch job in a unit test

The below code is to validate if an email has been sent from the finish method of a batch job using the Limits.getEmailInvocations(). The afterEmail variable is been set to 0 and no email is been sent ...
0
votes
1answer
14 views

How to make a call out from batch which (batch) get schedule from trigger?

I'm trying to call a method which do an api call. But I'm getting an error because this method get call through the process ran by batch and this is getting schedule from trigger. So even if i ...
0
votes
1answer
45 views

Multiple Nested Loops in Apex

Background: I have 3 objects: Contacts, Accounts, Campaign, that are involved in the scenario. Contact is the parent object, Accounts and Campaigns are child objects to contact(Related Lists) There ...
0
votes
2answers
29 views

Archive Accounts [closed]

What is the best way to archive accounts, after we have identified them as obsolete. ? I want to automate the process of archiving the obsolete accounts. These accounts become obsolete under two ...
-1
votes
2answers
55 views

Iterable Batch Apex

I want to write a batch class and need to make a webservice callout from it. Once the response is returned in Json format. I want to process the same into objects of salesforce. So I know how to make ...
0
votes
0answers
23 views

Is it possible to schedule sending a VF Page via Email?

We have this requirement that says we need to schedule once a month the sending of a VF page that contains custom dashboard charts via email. So if we break this requirement down, we need to do the ...
1
vote
1answer
28 views

Find what apex a cronjob Triggers

Scenario: Documentation on my org has a gap regarding a scheduled batch apex. This batch code updates a related list on the lead object. This List and process is call ‘nearby references’ and ‘find ...
2
votes
1answer
42 views

Why Would Batchable Not Run the Specified Scope Limit?

I call to a batch class on 204 records: PaymentAgreementMonitor myBatchObject = new PaymentAgreementMonitor(); Id batchId = Database.executeBatch(myBatchObject, 66); When it runs, it is running on ...
1
vote
2answers
67 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
2answers
70 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 ...
1
vote
1answer
45 views

Batch Test Class works in Production, Fails in Test

I've started a new job and the test code coverage here is poor. I am working to improve this and one of the batch classes has coverage of 77% in production. This is now below the org % so I thought I'...
0
votes
1answer
32 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: ...
0
votes
2answers
25 views

Ways to schedule a class in Salesforce [duplicate]

I want to know different ways by which I can schedule a class in salesforce!? I know we can do it using Developer console and SetUp.. But what are other ways by which we can schedule a class?
1
vote
1answer
38 views

AsyncApexJob record when I use System.scheduleBatch() method

I have just found a very strange behavior regarding Batch. If I have a Batch and run it using the method Database.executeBatch(), a new record inside AsyncApexJob table is created and I can use ...
1
vote
1answer
21 views

Issue with batch which is scheduled for every 5 minutes and didn't run for 24 hours and 5 minutes

we have batch which is scheduled to run every 5 minutes. This batch was working well for few months and then on 7th of November it didn't run for 24 hours and 5 minutes. After that, it is running ...
0
votes
1answer
52 views

Can we schedule a apex class at a time in different time zones

We have a batch class to updates events dates. But all the users are not in same time zone.Some users are in Uk,Some are in USA,Some are in India..etc My batch class will run every day at 1 am of ...
1
vote
1answer
26 views

How to change concurrencyMode Apex batch

The documentation (Unable to lock row - Record currently unavailable errors ) says to change 'concurrencyMode' to Serial instead of Parallel. But I can't find how to change this property in apex ...
3
votes
1answer
103 views

How can I delete/abort all scheduled jobs for a particular apex class?

I need to delete/abort all schedule jobs associated with a particular apex class. There are nearly 1500 scheduled jobs in my org. Any tips on how to approach this?
0
votes
2answers
41 views

How to write a unittest for scheduled apex

I have a scheduler for a callout class. I am trying to write a unittest for my scheduler but do not know how to test the execute part Class global class or_guestsSchedulable implements Schedulable{ ...
0
votes
0answers
21 views

Which Salesforce IP range to whitelist for an integration through scheduled apex batch

My situation is the following: I have a batch that is scheduled to run every hour, which does a callout to an external system. My org is located in the APAC region, but the user that scheduled the ...
1
vote
1answer
49 views

What are the design patterns how to do a batch callout

I know some basics on callouts but would like some advice on doing multiple callouts. Requirements: I have an external system where guests are registered this could be large amounts. I have to get ...
0
votes
1answer
24 views

Batch apex class use fetch account data with Email Message

i wrote a Batch apex class, and i will fetch the all Account Records, But in account having Phone value is Null for Some Records, Those Records will be send to Admin user Email, How to do this ...
0
votes
2answers
119 views

Best Practice to schedule a Batch

I am looking to find a best practice/framework to implement a schedulable batch. I don't know if create an Apex Class that implements Schedulable and Batchable interfaces is the correct way or create ...
0
votes
1answer
34 views

Schedule batch job using cron expression

I have a requirement where I need to schedule a batch job 4 times in a day, at 1 AM EST, 10 AM EST, 3 PM EST, and 8 PM EST. I have scheduled this using a cron expression in Developer Console. I ...
3
votes
1answer
146 views

batch apex finish method to schedule another batch job with scope of 100 due to callout limit

The schedule_batch_mdm_role_definition I believe is working fine. global class schedule_batch_mdm_role_definition implements schedulable { global void execute(SchedulableContext sc) ...
0
votes
1answer
84 views

How to Run Batch Class for Last 3 mondays of every month

I can not find any cron expression that allows me to run batch job for last 3 Mondays of every month. Lets say if current month has 4 weeks then I have to run the batch job for 2nd, 3rd and 4th Week ...
1
vote
2answers
35 views

Test Class for batch job, how to cover execute method

I am trying to write test class for a batch job, but I am not able to cover the execute method and to enter in it in order to debug my class. How can I cover this method? Batch job: /** * ...
0
votes
1answer
50 views

Not Able to reschedule apex batch class

enter code hereCurrently I have a batch which I'm scheduling after 2-2 minutes but because it has the same job name it doesn't allow to reschedule. Is there any way to reschedule the same batch. ...
1
vote
1answer
33 views

Is it necessary to create separate test classes for a Schedulable Class that triggers a Batch Class?

I have a Batch Class global class UpdateAssetInstallStatus implements Database.Batchable<sObject> { global Integer assetsProcessed = 0; global Database.QueryLocator start(Database....
1
vote
1answer
286 views

First error: Exceeded maximum time allotted for callout (120000 ms)

I have a Batch class making an API callout and I have scheduled this class. I have used a for loop to iterate through the page number variable in my API endpoint. There are 64 pages. Strangely, if I ...
2
votes
0answers
61 views

Scheduler test class fails while packaging

Scheduler Class: global with sharing class Demo_Scheduler implements Schedulable { global void execute(SchedulableContext sc) { Database.executeBatch( new Demo_Batch(new List&...
1
vote
1answer
77 views

Scheduling Class to insert new Records

I have written a Schedule Class to insert records when a certain record's date is four days ago. It should insert a new record but of a different record type. So for Example, if a package record type ...
0
votes
1answer
19 views

Endpoint can not be null issue in scheduled batch callout job

I struggle with execution of HttpRequest POST in my Scheduled Batch job. I have written Test and Mock classes to test the callout itself (without Batch job) and it returns http code 200. My debug ...
0
votes
1answer
32 views

Retrieve information from other Org using REST Callout

I am new in salesforce and i have a REST request callout to retrieve the information from the other ORG. My problem is, I don't know if my code is correct since there is no error but in my VFPage, ...
2
votes
1answer
362 views

How to schedule an apex batch with callout?

I am able to do callout using apex batch with user interaction (on demand). So when user click the button, this apex batch will run without any problem calling the apex batch: global class ...
2
votes
1answer
95 views

Apex class's behavior mysteriously changing after debug statement removed

I've run into a pretty maddening issue. The simple batch class below looks up certain campaign members and deletes them. It works fine, but when I comment out the debug statement on line 29, the ...
0
votes
2answers
163 views

Test class for Scheduled Batch class making a callout in the start method

I have two classes - BatchClass and SchedulerClass. Batch class makes an API callout in the start method and return the list of records to insert. This class is scheduled with the help of ...
0
votes
1answer
92 views

Salesforce: how to send email alerts on specific dates in salesforce using schedule apex?

I want to send email alerts to user which are lookup with account (user field is lookup in account) at the start of every quarter, based on a picklist. My proposed picklist values, and their desired ...
-1
votes
1answer
122 views

Getting batch id after scheduling a batch

I am using the method System.scheduleBatch , this method returns the scheduled job ID (CronTrigger ID). However, I need also the batch id because I need to monitor the bach. Is there any way I can ...
0
votes
0answers
121 views

Send automated notification after Bulk Data Load job is completed. Is that possible? ( like automation)

I’m trying to set up an automated monitoring on bulk data loads. We regularly load data into Salesforce using default Informatica powercenter ( another database). Results can be inspected in the ...
2
votes
1answer
524 views

How to schedule the class for every one minute in salesforce?

To schedule class for every one min i tried this one but it schedule after 1 hr. Is my Cron expression is correct or i did some other mistake...?? global class MorningMailSchedule1 implements ...
0
votes
1answer
44 views

How to update checkbox bases on values childobject

I have this batchclass where I update a checkbox on account based on related assets. How do I set the checkbox to true If 1 of the assets is true and to false if all assets are false. I would have to ...
0
votes
1answer
240 views

Batch error: Attempt to de-reference a null object with check for !=null

I have a batch apex where I insert some records. I check on the fields for != null but still get the error: Attempt to de-reference a null object Here is my batch part: global void execute(...
0
votes
1answer
35 views

How to create an iterable structure: <AccountId, UserIdLastModifiedInAgivenAccountTeamMemberRole>

In Apex How would I get from this: List<Account> accountsWithTeamMembers = new List<Account>( [select id FROM account where id IN (SELECT AccountId from AccountTeamMember]); ...
0
votes
1answer
34 views

Schedule Iteration of Webservice Callouts

I have an endpoint I am getting updates from, but the only arguments the end point takes is two date parameters. To keep the heap size down, I am limited to about a date range of three months. I am ...
-1
votes
1answer
81 views

Batch Class hitting HeapSize limit

have written batch class to do some calculation with Opportunities under each Account and after the calculation some needs to be updated in the Account Object. there are some Account which has 25k ...
1
vote
2answers
282 views

FIELD_INTEGRITY_EXCEPTION, This price definition already exists in this price book

My requirement is to take any pricebook entry made in the standard pricebook and replicate/update it in a second price book. With the code below I keep getting the error FIELD_INTEGRITY_EXCEPTION, ...
0
votes
1answer
75 views

How to schedule a batch apex for every 30mins

I have a usecase in which need to schedule a batch class for evert 30 mins. Client denied to provide access to developer console in production. What will be the other way to do that.
0
votes
1answer
295 views

Delete last 10 days data Through batch class

How to delete last 10 days data using batch class I am Trying to using below code but data not deleted please check and give me suggestion to acheive this requirement. global class ExampleBatchClass ...
0
votes
1answer
64 views

Scheduled class is not executing batch class [duplicate]

I've set up a schedulable class that calls a batch class, but when I run the test class, it successfully calls the schedulable class, but the batch class is never called. What am I missing? Here is ...