You need to sign in to do that
Don't have an account?
Chinna Sfdc
Internal salesforce.com error
Hi Team,
I have created a batch apex class and executing that code using "Anonymous Block". I am monitoring the batch operations in debug logs and noticed the operation name as "SerialBatchApexRangeChunkHandler" with status "Internal Salesforce.com Error". Can any one please help me to acheive this error.
Here is my Batch Apex logic:
global class OpportunityCWDays implements Database.Batchable <Sobject>{
Public List<Opportunity> lstOpp;
global Database.QueryLocator start(Database.BatchableContext BC){
String query = 'Select id, Name, StageName, Software_Product_Count__c, CW_in_Last_30_Days_Formula__c, CW_in_Last_30_Days_Workflow__c, CW_in_Last_730_Days_Formula__c, CW_in_Last_730_Days_Workflow__c from Opportunity Where StageName = \'S8- Closed Won\' AND Software_Product_Count__c > 0 AND ( ((CW_in_Last_30_Days_Formula__c = True AND CW_in_Last_30_Days_Workflow__c = False) OR (CW_in_Last_30_Days_Formula__c = False AND CW_in_Last_30_Days_Workflow__c = True)) OR ((CW_in_Last_730_Days_Formula__c = True AND CW_in_Last_730_Days_Workflow__c = False) OR (CW_in_Last_730_Days_Formula__c = False AND CW_in_Last_730_Days_Workflow__c = True))) ';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<Opportunity> batch){
lstOpp = new List<Opportunity>();
for(Opportunity objOpp : batch){
if(objOpp.CW_in_Last_30_Days_Formula__c == True){
objOpp.CW_in_Last_30_Days_Workflow__c = True;
}
else{//if(objOpp.CW_in_Last_30_Days_Formula__c == False){
objOpp.CW_in_Last_30_Days_Workflow__c = False;
}
if(objOpp.CW_in_Last_730_Days_Formula__c == True){
objOpp.CW_in_Last_730_Days_Workflow__c = True;
}
else{//if(objOpp.CW_in_Last_730_Days_Formula__c == False){
objOpp.CW_in_Last_730_Days_Workflow__c = False;
}
lstOpp.add(objOpp);
}
Database.SaveResult[] dbOppList = Database.Update(lstOpp,false);
//System.debug('Update CW ' + dbOppList[].Id);
for(Database.SaveResult sr : dbOppList){
if(sr.isSuccess()){
// Operation was successful, so get the ID of the record that was processed
System.debug('Successfully Updated OPP ID: ' + sr.getId());
}
else{
// Operation failed, so get all errors
for(Database.Error err : sr.getErrors()){
System.debug('The following error has occurred.');
System.debug(err.getStatusCode() + ': ' + err.getMessage());
System.debug('Users fields that affected this error: ' + err.getFields());
}
}
}
}
global void finish(Database.BatchableContext BC){
}
}
Thanks
I have created a batch apex class and executing that code using "Anonymous Block". I am monitoring the batch operations in debug logs and noticed the operation name as "SerialBatchApexRangeChunkHandler" with status "Internal Salesforce.com Error". Can any one please help me to acheive this error.
Here is my Batch Apex logic:
global class OpportunityCWDays implements Database.Batchable <Sobject>{
Public List<Opportunity> lstOpp;
global Database.QueryLocator start(Database.BatchableContext BC){
String query = 'Select id, Name, StageName, Software_Product_Count__c, CW_in_Last_30_Days_Formula__c, CW_in_Last_30_Days_Workflow__c, CW_in_Last_730_Days_Formula__c, CW_in_Last_730_Days_Workflow__c from Opportunity Where StageName = \'S8- Closed Won\' AND Software_Product_Count__c > 0 AND ( ((CW_in_Last_30_Days_Formula__c = True AND CW_in_Last_30_Days_Workflow__c = False) OR (CW_in_Last_30_Days_Formula__c = False AND CW_in_Last_30_Days_Workflow__c = True)) OR ((CW_in_Last_730_Days_Formula__c = True AND CW_in_Last_730_Days_Workflow__c = False) OR (CW_in_Last_730_Days_Formula__c = False AND CW_in_Last_730_Days_Workflow__c = True))) ';
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, List<Opportunity> batch){
lstOpp = new List<Opportunity>();
for(Opportunity objOpp : batch){
if(objOpp.CW_in_Last_30_Days_Formula__c == True){
objOpp.CW_in_Last_30_Days_Workflow__c = True;
}
else{//if(objOpp.CW_in_Last_30_Days_Formula__c == False){
objOpp.CW_in_Last_30_Days_Workflow__c = False;
}
if(objOpp.CW_in_Last_730_Days_Formula__c == True){
objOpp.CW_in_Last_730_Days_Workflow__c = True;
}
else{//if(objOpp.CW_in_Last_730_Days_Formula__c == False){
objOpp.CW_in_Last_730_Days_Workflow__c = False;
}
lstOpp.add(objOpp);
}
Database.SaveResult[] dbOppList = Database.Update(lstOpp,false);
//System.debug('Update CW ' + dbOppList[].Id);
for(Database.SaveResult sr : dbOppList){
if(sr.isSuccess()){
// Operation was successful, so get the ID of the record that was processed
System.debug('Successfully Updated OPP ID: ' + sr.getId());
}
else{
// Operation failed, so get all errors
for(Database.Error err : sr.getErrors()){
System.debug('The following error has occurred.');
System.debug(err.getStatusCode() + ': ' + err.getMessage());
System.debug('Users fields that affected this error: ' + err.getFields());
}
}
}
}
global void finish(Database.BatchableContext BC){
}
}
Thanks
Unfortunately, "Internal Server Errors" are VERY difficult to debug. They typically involve a call into Salesforce to look up a "Gack" (only a few internal Salesforce employees have the ability do do this). Even when they're able to lookup the Gack, it's not always evident what the root cause is.
However, if I were you, I would start with stripping out much of your batch class and then start adding pieces back in one by one into your batch class, so that you can narrow down the culprit.
For instance I would check the following:
1) Does the batch class work with just the query and a simple system.debug(batch);
2) Does the batch class work with just theq query, a simple system.debug, and adding the batch opportunities to a list?
3) Does the batch class work with just the query, system debug, adding to the list and doing an update lstOpp?
4) Does the batch class work with the query, system debug, adding to the list, and doing the partial processing?
After looking at your code though, it looks like it *may* be that you're using a member variable in your batch class when you don't need to. I suspect that this is the exception you're running into, although it could also be the fact you're using partial processing (Database.update(list,false)).
Give that a whirl and see if it resolves your Internal Server Error. Good luck!
Thanks
Thanks
Error Number: 1864495260-204529 (245827274)
Do you have an error number I can refer to, or is this just a normal application error in your logs?
Thanks
Thanks
You Internal Server Error is caused by something else. Do you see any other errors in the logs?
We have facing below internal salesforce.come error.
"An error has occurred while processing your request. The salesforce.com support team has been notified of the problem. If you believe you have additional information that may be of help in reproducing or correcting the error, please contact Salesforce Support. Please indicate the URL of the page you were requesting, any error id shown on this page as well as any other related information. We apologize for the inconvenience.
Thank you again for your patience and assistance. And thanks for using salesforce.com!
Error ID: 1690312637-24627 (-698368428)"
Can you please help me on this.
Thanks
The exception is:
sales.opportunity.InvalidRollupException: common.exception.SfdcSqlException: ORA-20423: invalid opp rollup count: 1
I think this is a PLSQL routine throwing an exception because an assertion failed. If you can't find a validation rule that causes the error, Salesforce Support could run some "scrutiny" tests to ensure that your data is clean.