Batch apex refers specifically to Apex classes which implement the Batchable interface.
0
votes
1answer
28 views
Batch class test class.?
I am trying to increase test class coverage of batch class..how to fulfill if condition in batch class.I am using this batch class for sending email 15 days prior to release date.I am stuck at test ...
1
vote
1answer
19 views
Salesforce Integration with External Scheduler
I'm currently working with a customer that is interested in launching Salesforce Batch jobs from an external scheduler. I was thinking about the following
- Create a global interface
global ...
2
votes
1answer
54 views
Batch Apex throwing error when executing query ( SQLException [common.exception.SfdcSqlException: ORA-01013:)
I am trying to execute a Batch job that is processing around 2 million contacts, I batch Apex whenever I try to execute is throwing an error
First error: SQLException ...
8
votes
2answers
53 views
Is there a simple way to serialize execution of Batchable class?
I need to Geocode addresses on Account using an HTTP callout; the webservice will only service one address per callout. For this use case it is preferable to geocode the accounts immediately, rather ...
5
votes
1answer
35 views
Has anyone else experienced issues with the apex job scheduler?
The follow scheduled apex jobs highlighted below (in yellow) are configured to run daily, and were scheduled to start this morning - however, they have not ran since 10/12/13. Has anyone else ...
1
vote
0answers
55 views
code coverage for batch class
How can i get increase coverage for this code? I get only 55% so far.
Also, when I am doing an assert, it should not be equal to '0' but for some reason if i do that then it complains saying it ...
5
votes
1answer
45 views
Fetching records with SOQL in batch apex
Some SOQL starts batch job with 'where' clause. This batch job is running several minutes/hours and some records from original set change state and don't satisfy original SOQL 'where' conditions. How ...
7
votes
2answers
129 views
Too many SOQL rows returned (limit exception) - 50001
I am getting Too many Soql rows returned:50001 (limit exception) on below line of code
list cvlist= [Select c.Id, c.ContentDocumentId From ContentVersion c where c.Syn_Documents__c!=''];
global ...
3
votes
2answers
106 views
Best practices for monitoring Scheduled Apex and Batch Apex?
We have multiple Apex jobs running, both from Schedulable and Batchable code. While an attentive SA could examine the Apex Jobs list to check that everything is OK, it seems a better idea to have ...
0
votes
2answers
51 views
How apex get Executed
i write a Batch apex.i write an execute method .which is using a static variable of another class.because it is shhared.any one can use it and change it.
public void execute(Database.BatchableContext ...
4
votes
1answer
62 views
Batch code doesn't update records
EDIT : I have updated my code in here.
I am attempting to see if an Account's parent has the X2_0_Ultimate_Parent_c field populated. If it does then I would like to populate the UPName_c field in the ...
2
votes
5answers
196 views
System.CalloutException: You have uncommitted work pending. Please commit or rollback
I am sending only a single HTTP Request in Batch but still facing error System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out
My test code is
...
1
vote
1answer
42 views
Testing Batch apex code with two batches
i am trying to test a trigger my trigger code is
trigger PostFeedsToTimeLine on FeedItem (after insert) {
Map<String,String> contentMap = new Map<String,String>{'Object' ...
4
votes
1answer
114 views
Apex cron job command to schedule an apex job to run every 4 hours daily
I have a requirement where i need to run an apex batch job every 4 hours daily monday to friday and all months in a year. I looked at the apex cron job documentation to be setup using code snippets in ...
3
votes
1answer
30 views
what should be the Salesforce batch job Submitted time if the batch job is QUEUED?
If a Salesforce batch job kicked at 3:00 pm and due to Queue creation at salesforce(if more than required batch are running simultaneously), than what should be the Apex job time stamp for submitted ...
3
votes
1answer
52 views
Fetching records of an Object whose particular field got updated in past hour
I am running an hourly batch. This batch should pick all the records of an object say abc__c whose particular field Eligible__c is set to true in past one hour. I am trying to fetch these records by ...
1
vote
1answer
58 views
Sobject type not supported in Managed Package
I have recently created a managed package . To test it, I installed it in a fresh developer org. This package queries the account records and updates certain custom fields(part of the package) on ...
4
votes
1answer
252 views
Using Batch Apex on millions of records
Part of our app behaviour is going over millions on records and updating their data.
From what I read, we can do it using Batch Apex although I am not certain I fully understand how it works.
Here ...
6
votes
2answers
148 views
How to test that Apex Batch finish() sends an email?
I have a Batch class that sends an Email from its finish method and want to test that. a But....I cannot test it. The the above test fails as there was no email invocation at all. BUT: I see it in the ...
6
votes
2answers
168 views
Batch @future calls?
Im trying to build what seemed like a simple SMS messaging application using Twilio's api and running into a few strange momments.
So I have an SMS object that stores the messages and i wrote a ...
1
vote
1answer
126 views
HTTP callouts in Batch Apex
There are 1200 records/accounts in the 3rd party cloud based billing system. I need to update the records in SFDC.
Now for each record, I need to do 2 callouts. I am thinking to write batch apex for ...
2
votes
1answer
148 views
Too many query rows: 50001
I am getting Too many query rows: 50001 when i run the batch apex.
Below code is part of batch apex (FInish Method).
Also there is a soql inside for loop .can someone help me fixing this.
Thanks
...
4
votes
1answer
108 views
Batch execute is slow because of huge unused gaps in DevConsole timeline
I have a long running batch that is taking days to execute and creates millions of records. To speed it up I used the profiling tools of the Developer Console.
Per batch execute() I see this timeline
...
1
vote
2answers
62 views
Account Roll up of contacts meeting certian criteria
I need to know at the account level how many contacts under this account match certain criteria. In this case, its whether or not a custom checkbox field is checked. So for instance, if under Acme ...
2
votes
0answers
19 views
Will (Minor) Push upgrades conflict with running batches?
What will happing to running Apex Batch jobs when I perform a Push (Minor) Upgrade (Patch) into a customer org?
Is that save to do? Under which circumstances?
I could not find documentation or any ...
0
votes
1answer
109 views
Maximum size of Map<Id,Id> in Batch start() before reaching limits
To do some de-duplication (1: no SELECT DISTINCT in SOQL, 2: GROUP BY restricts me to 50 K records) I rely on a Map in my Batch start() method. How many entries can this map have before I reach the ...
0
votes
1answer
63 views
Create Batch Apex
I'm having trouble creating a BATC apex. I need to make a condition in the start method
If the record type of opportunity equals donation executes a query if the record type = membership runs another ...
2
votes
1answer
126 views
How to Search a text in all fields in all objects and return all values?
Can I find a string from all fields from all custom and standard objects and return the data (all field data) of all the records that matches for all the fields of those objects??
Also is there an ...
1
vote
1answer
75 views
Custom Settings - suitable for use to stop long-running Batch?
Can a long-running Batch use a Custom Setting's value as an indicator as to whether or not it should continue to process records?
I have a batch that will process a few thousand records that could ...
0
votes
0answers
32 views
Why does this Batch always and only abort in Production?
I have a long running asynchronous process that process millons of records in a CustomObject__c. To prevent other limits we have split this into 2 Batch classes that work on this table in parallel. So ...
1
vote
2answers
44 views
Why do batches behave different in Production than in a Sandbox
Recently I observed serious and undocumented differences in the runtime behaviour of Sandbox vs. Production orgs, e.g.:
Batches (same code, same data) run faster in the Sandbox
Same Batch in Sandbox ...
3
votes
1answer
72 views
How to escape < in querystring
I have a batch class with a query string in which I want to limit the query to records last modified before a datetime, but the '<' char seems to need escaping and I can't find any documentation to ...
3
votes
1answer
199 views
Recursive functions APEX
I had a use case where i had to traverse through account hierarchy (whose business limit is infinite). So i tried ...
-1
votes
2answers
305 views
Save error: Initial term of field expression must be a concrete SObject: LIST<EventRelation>
ayudad need.
I want to create a batch class to update values āāfrom another object.
this is my code but it is giving me this error
anyone can help?
Thanks.
This is the start and execute section.
...
1
vote
0answers
184 views
Can an already running batch job abort automatically?
Is there a way to find out which user aborted a batch job?
I randomly see batch jobs abort without a reason (in the logs I see an Internal Salesforce error to happen around the time of abortion) and ...
0
votes
1answer
341 views
Scheduled Batch Apex Hangs in Queued Status
This is my first crack at a scheduled batch Apex class. Copied the code from the manual but missing something. When I run class MassDeleteSchedules in Anonymous block, it works fine. But when I use ...
2
votes
2answers
137 views
Are batch jobs guaranteed to run sequentially?
I encounter an UNABLE_TO_LOCK_ROW error in a batch job where I do an upsert on a custom object. The problem is that I am not able to guarantee that a particular record is only upserted in one single ...
3
votes
3answers
89 views
Tracking errors in batch impossible as Dev Console stops logging or breaks with Server error
When single batch jobs fail only the last one is party shown in the Apex Logs page. This is not enough for debugging.
A better way ist to check the log entries that are written per batch execute.
...
3
votes
2answers
150 views
Getting CalloutException when testing Batchable class with Callouts and HttpCalloutMock
I'm trying to write test code for a Batchable class that AllowsCallouts. I've written a lot of other test code that uses HttpCalloutMock classes, and planned to do so for this class as well.
And, ...
0
votes
0answers
52 views
System.UnexpectedException: Error processing messages
Yesterday I was running my unit tests with no errors, but my latest execution gave me the error: "System.UnexpectedException: Error processing messages".
Today I tried again getting the same issue. I ...
12
votes
5answers
825 views
Scheduled batch jobs and durability
I have a process that runs scheduled Apex quite regularly as a batch job manager. This process runs on a one-time schedule, and looks into a batch job table (custom object). If it finds work to do, it ...
1
vote
2answers
691 views
Turning into Batch Apex using Database.QueryLocator
I want to turn my trigger code into a batch Apex, however, i am encountering a number of problems with it. Posting both the original and the batch codes. Please can anyone suggest what changes to add ...
1
vote
1answer
160 views
SOQL query 101 error when calling trigger. Want to fix using Batch Apex. Is it feasible?
I've created a trigger for an Opportunity object that updates a lookup field with the value of the ownerID.
Here is the trigger code:
trigger trig_Opportunity_CreateOppOwner on Opportunity (before ...
2
votes
3answers
269 views
More than 5 Batch Apex issue
I am getting the below issue, while performing Run All test in my Org. we have a good amount of batch classes,around 15, and we wrote the test classes for them where we are calling the batch ...
1
vote
1answer
218 views
Singleemailmethod with BCC and Template ID
I am using a batch class with 4 differnt VF templates to send emails to 4 different regional heads usingsingleemailmethod() so I am using 4/10 singleemail methods in the batch class.
singleemail ...
4
votes
1answer
82 views
Batch Jobs in Group and Prof. Edition
I have installed a Managed Beta Package in a Group edition Org. I have a Apex batch job which runs onClick of a button and saves the results to a Custom Object.
I then display the results in an ...
4
votes
1answer
80 views
Is there any way to unit-test that a function will run into a LimitException?
I need to write a test that verify that a function call is run synchronously.
As I have found no elegant way to find that out I now let my function run into a Limit which is an indirect proof that ...
5
votes
2answers
552 views
Testing Batch Job with HTTP Callouts
Suppose I have the following:
global class CMBatchRegisterUsers implements Database.Batchable<sObject>, Database.AllowsCallouts, Database.Stateful {
global final String orgID = ...
1
vote
1answer
440 views
Scheduling a visualforce page as CSV
I am posting my approach, but still unable to send the VF page data as email attachment.
scheuler + batch :
global class Schedule_report implements Schedulable
{
global void ...
5
votes
1answer
141 views
Leads 'Unread By Owner' - Workflow on this field
I need to send an email if a particular lead is not opened after 2 days of assignment.
There is a field called IsUnreadByOwner, but we cant access this field through workflows or formulaes.
Is there ...