Questions tagged [batch]

Classes implementing the `batchable` interface are used when there is a need to operate on a large number of data records which would normally be problematic due to the imposed governor limits.

313 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
84 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
1answer
557 views

Identify and mark duplicate records in Opportunity using Apex and SOQL

I have about 400K records in opportunity object which needs a cleanup of duplicate records using a batch class. I don't want to delete the duplicate records, I want to check them as 'prospective ...
0
votes
0answers
376 views

Not covering batch execute method querying CampaignMember

AccountActivityUpdateBatch class execute method is not covering the for loop. Here is my test class. @istest public class AccountActivityUpdateBatchTest { @testSetup static void setup() { ...
0
votes
1answer
164 views

Apex CronTrigger Throws error while aborting: Job does not exist or is already aborted.

I keep getting this error when I try to abort a scheduled job in my batch job code. Below is my code: Datetime dt = system.now().addMinutes(Integer.valueof(myCustomObject.Time_Interval__c)); ...
0
votes
1answer
222 views

Help updating record's field with lookup's child record

I have three objects: Order__c Package__c Account Package has a relationship with account and order. Order has a relationship with account. If a package has an account attached to it, how can I ...
0
votes
1answer
185 views

Test batch class - object WorkOrder

I'm building a batch class to update the WorkOrder. But I can't call the method execute to test this part. How can I test my logic inside the try in the execute method in batch classes? global class ...
0
votes
1answer
208 views

Method does not exist or incorrect signature: void schedule(String, String, UpdateCloseDateOpportunityBatchClass) from the type System

When i try to create a scheduler class I am getting an error Method does not exist or incorrect signature: void schedule(String, String, UpdateCloseDateOpportunityBatchClass) from the type System ...
0
votes
0answers
174 views

Sync LastLoginDate from User object to Contact object (Community Portals)

Using this as a reference: https://developer.salesforce.com/page/Synchronizing_Portal_Users_with_Contact_Record_Data I am trying to sync the date in the LastLoginDate field on the user object with a ...
0
votes
1answer
272 views

Help on Cases batch class

I have created the batch class which will store the count in other object with status "New" and "Closed" I have 60 Case records with 25 as "New" status and remaining with "Closed" status when i am ...
0
votes
0answers
543 views

How to unschedule/reschedule Batch apex which is scheduled via UI?

I have a batch apex in my Org. which runs every night. I scheduled it via User Interface. Now I want to re-schedule it via UI. How do I do that?
0
votes
1answer
556 views

SandboxPostCopy interface implementation

I have some problems with the SandboxPostCopy interface test class. My goal is to clean some sensitive data on some Object after a refresh. The class is this: global class CleanSandbox implements ...
0
votes
0answers
646 views

Call Multiple Batch Job in Scheduler Class(Best Practice)?

I haven't worked on Batch/Scheduler class before.In our org we have an existing scheduler class written as below: Apex Class: global with sharing class SchedularForBatchApex implements Schedulable { ...
0
votes
3answers
473 views

Not able to update the WhoId field on Task and Event records

I have a batch process that updates the WhoId field of Task records. When this batch process executes, I am currently getting the following error: Update failed. First exception on row 0 with id ...
0
votes
0answers
148 views

Batch Apex/Trigger for Rollup the data with M-D Relation

We have a parent Account record "Test ABC" and child Accounts record "Test X" and "Test Y". We have a Child object(Custom Object) Child__c. It is Master detail relation with AccountObject. ...
0
votes
1answer
1k views

Executing a batch class based on the class name or id entered in as a string or id

I am creating a page in Salesforce that lists all our batch classes and will allow you to execute each one individually. Basically I am querying every ApexClass, finding the batchable ones, and ...
0
votes
1answer
112 views

Batch Class running for multiple iterations

When I run the bacth class below through Developer COnsole, I see that the batch class generates 100's of emails though the specify batch size as 1. Can some one help me with this global class ...
0
votes
0answers
311 views

Getting Error “java.io.IOException: Missing cursor chunk (offset 7000, count 400)”

I have a batch class which I deployed to production instance, I am getting following error: Developer script exception from ClinetOrgName: 'MyBatchApexClassName' : java.io.IOException: Missing ...
0
votes
1answer
28 views

Parameters determining the batch processing speed

Suppose I have batch class which runs an operation on all the leads present. If I have 1 million records and my batch class executes 2000 records at a time, this means I have 500 batches. What are the ...
0
votes
0answers
27 views

Embedded Batch apex class

Hello Everyone i have This code--> Date startDate = Date.today().toStartOfMonth(); Date endDate = startDate.addMonths(3).toStartOfMonth().addDays(-1); List<IPfolio__Renewal__c> renewals = new ...
0
votes
1answer
36 views

hi guys can any one help me

If I create a record of cumtomer_order__c which are related to account object so rest of account which have aslo cutomer_order__c records automatically update last I am using Bacth class and Schelud ...
0
votes
1answer
162 views

Batch Apex creating Multiple contentdocumentlinks when trying to “convert” tasks to notes…

I am trying to look at all tasks for a specific time frame, then create a note and set the LinkedEntityId to the whatid or whoid. This code creates the content note, 1 for each task. But then created ...
0
votes
0answers
163 views

Apex Batch Callouts

Everytime an record is created in salesforce by external system we need to send the same record with updated values to the external system. When we receive bulk of records say some 10000 or more. I ...
0
votes
0answers
1k views

Portal account owner must have a role

I am trying to insert portal users in using dev console but it is showing this ERROR MESSAGE Line: 34, Column: 1 System.DmlException: Insert failed. First exception on row 0; first error: ...
0
votes
0answers
1k views

Apex Batch job not sending out mails after batch is completed

i have created (my first) batch apex class to set leads that where not touched for over a year to 'automatically closed' and when testing it updates the records correctly. However it does not send out ...
0
votes
0answers
701 views

Scheduled Batch Apex Class Not Working

I created a scheduled batch class that is supposed to update account's name field value. But it is not working. Batch Class global class UpdateAccountBatchCX implements Database.Batchable<sObject&...
0
votes
1answer
299 views

Display Exceptions of batch Class on vf page

I have a button on a record, once I click that button it will call a VF page, in that VF page a controller will call a batch class and if we get any exceptions coming from the batch class, I need to ...
0
votes
1answer
36 views

Batch Matching Job only merging the first match in query

Hi I have a batch matching job running in salesforce. It was working and then I did something and now it has stopped functioning as I intended. I've tried debugging but for the life of me can't figure ...
0
votes
1answer
58 views

Create a Batch Queue so each batch is 30minutes apart, schedulebatch

As it stands I am looking to schedule a batch so that each batch will send 100 emails, wait 30 minutes, then sends the next 100 emails. This will happen until all the the associated apexjobs to my ...
0
votes
1answer
171 views

Test method passes when run individually, but hits CPU limit when run with other methods

I'm working on an apex class that does the following: On a given record, compress field data from it and four child objects into CSV format on a long text field Export the compressed data to files in ...
0
votes
0answers
34 views

why my batch count is getting change?

Today i noted something while monitoring the apex job. My batch job scope size is 20 . I have 30,000 user. so the number of batch should be 30,000/20 = 1500 (batches). But i saw it keep on ...
0
votes
0answers
148 views

Forming a soap request with Multiple records

I am trying to create a batch class which would query a list of records and makes an apex callout to an external system. How can I go about writing this batch class? For a single request I can write ...
0
votes
0answers
1k views

Identifying records via Batch Apex timing out. REQUEST_RUNNING_TOO_LONG

I'm trying to identify task records in a production org. The problem is that the data volume is too large to create a report or one-off SOQL Task records. Our task records are huge and are in ...
0
votes
1answer
364 views

batch apex with json response

Json response i got from facebook API. Used wrapper class to deserialize. { "accounts" : { "data" : [{ "picture" : { "data" : { "is_silhouette" : ...
0
votes
1answer
106 views

Sending SMS to Contacts using Twilio

I need to send sms to contacts using twilio on a weekly basis.I have the code for sending sms but I need to call this class using batch apex on a weekly basis.Does anyone have code for the same?
0
votes
0answers
2k views

Callout from Batch Apex

I have a Apex Batch class which first does DML on the relevant records, and then makes a callout. When I try running it, I get the error: You have uncommitted work pending. Please commit or ...
0
votes
1answer
147 views

Help in converting Trigger to Batch class

All, here is my trigger and I want to convert this trigger into a batch class. I have 3 objects on this trigger. Account, Margin__C and commission__c. Use case: This trigger currently run on ...
0
votes
1answer
268 views

batchapex in salesforce account field value update

Global class praveen implements Database.Batchable<Account> { global Database.Querylocator start(DataBase.BatchableContext Bc) { string Query='select name,discription from account'; return ...
0
votes
3answers
138 views

Test class problem for a batch class

I have a test class for a batch class that I can't get above 82% coverage. There is one part of the batch class that the test does not go into. I think it should be but it isn't. Any help is ...
0
votes
1answer
151 views

Help for Batch Apex Running

I want to know how to bypass the trigger in Batch apex code.Actually problem is when we are trying to run the batch apex we are facing some errors i think some triggers are firing.Please help me to ...
0
votes
0answers
145 views

Batch Job Completes Without Updating Values - Formula Field in WHERE clause

I have the batch job below that is running and completing successfully, but not updating any records. When I run the query in the query editor I get 135 results, so there are records that need to get ...
0
votes
1answer
42 views

Batch Class for Append

I have written the batch class for adding a count to my Custom field Project_ID__c. As my Project_ID__c contains the Data like 1,2,3 i.e I want to append count in front of my Project_ID__c. For ...
0
votes
1answer
275 views

batch class not running due to too many soql queries

I have a batch class to update case object. When i am running this job, getting an error: Too many SOQL queries. Can some one help me to write the 'query on feeditem' out side of the for loop in ...
0
votes
0answers
36 views

Not able to make HTTP callout to salesforce service from Batch class?

Not able to make HTTP callout to salesforce rest service from Batch class. In rest service we have a code to send emails. Earlier it was working fine but since last few days emails are not being sent ...
0
votes
1answer
94 views

Help with test class for Batch Apex

Below is my callout class which makes two different callouts to external system. In callout 1, it gets a token. In Callout 2, it uses that token to retrieve the actual data. For some reason, I`m not ...
0
votes
0answers
111 views

Batch Apex on Account not working

Working on a requirement where on Account if NSC(checkbox field) and Status is Active And Case Record Type is equal to NSC Action then every year a Task on Case should be created whose due date is ...
0
votes
0answers
841 views

Batch Job Completes, but does not update records

I have a batch job that runs every day at 3am that I invoke through Execute Anonymous window in the developer console. It had been working correctly until we made a change to the query's filter ...
0
votes
2answers
261 views

Apex CPU time limit exceeded in Batch Apex

When we are running the batchApex we are facing "CPU time limit exceeded". Please find my below Batch Apex which we are tried and let me know where we made the mistakes in current Logic. Batch: ...
0
votes
0answers
41 views

Export Salesforce data to external source

I have a batch job that exports sObjects using some criteria to external service. To reduce amount of data for sync I sync only objects that have been changed by users since the last sync. To detect ...
0
votes
0answers
285 views

Scheduling multiple batch classes from postinstall script of managed package

I know we can schedule batch classes from post install scripts, but need to confirm this in my scenario. I have to schedule two batch classes which will update the data of two objects and also insert ...
0
votes
1answer
197 views

test class code coverage problem approval process with processs instance workitems

in below test class is not covering the BatchSendEmailAlerts8 code guide me where i am wrong...not covering part: mailIdsMap.put(PIobj.ProcessInstance.TargetObjectId,PIobj.actor.email); and ...

1
3 4
5
6 7