• tsailingw
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies

I uploaded a class implementing the Database.batchable interface into our live environment. It ran with a couple of errors and I decided to remove it and go another route.

 

The problem is that I now seem to be unable to remove the class. I tried cleaning out the contents of the class, like thus:

 

 

global class CalcSummaryBatch {	
}

 

 

The class above saved successfully without any errors, but Salesforce still refuses to allow me to delete the class, or save it as Inactive.

 

Here's the error that I'm getting: "This apex class is referenced elsewhere in salesforce.com. Remove the usage and try again.: Apex Job - xxxxxxxxxxxxxxxxxxx."

 

Here's the log under Setup > Monitoring > Apex Jobs. I double-checked, and all jobs are at a Completed status:

(There are about 20 such messages as the one below, all with status "Completed", and all the Apex Job Ids are listed as why the class cannot be deleted, in the error above)

Action
 Submitted Date
Job Type
Status
Status Detail
Total Batches
Batches Processed
Failures
Submitted By
Completion Date
Apex Class
Apex Method
 <nothing listed here>
 4/10/2011 11:00 PM Batch Apex
Completed
 First error: Attempt to de-reference a null object 0 0 1 xxx 4/10/2011 11:00 PM CalcSummaryBatch  <nothing listed here>
...

I have the following code --

 

Date ad = this.event.Start_Date_vod__c;
Date bd = this.event.End_Date_vod__c;
Integer di = ad.daysBetween(bd);
cm.avai0 = ad+' booyaaa '+bd;

 Edited to add -- both Start_Date_vod__c and End_Date_vod__c are declared as datatype Date in the SObject.

 

 that throws the error --

 

java.lang.String cannot be cast to java.util.Date

 

 When I comment out this line --

 

Integer di = ad.daysBetween(bd);

 

The error goes away and the code continues to run. I'm not sure what I'm doing wrong. I'm comparing the days between two date objects. I tried using comparison operators such as > and < but that throws the String cannot be cast as Date error as well.

 

Any help is appreciated.

 

 

 

 

Message Edited by tsailingw on 05-09-2009 12:54 PM
Message Edited by tsailingw on 05-09-2009 12:54 PM

I uploaded a class implementing the Database.batchable interface into our live environment. It ran with a couple of errors and I decided to remove it and go another route.

 

The problem is that I now seem to be unable to remove the class. I tried cleaning out the contents of the class, like thus:

 

 

global class CalcSummaryBatch {	
}

 

 

The class above saved successfully without any errors, but Salesforce still refuses to allow me to delete the class, or save it as Inactive.

 

Here's the error that I'm getting: "This apex class is referenced elsewhere in salesforce.com. Remove the usage and try again.: Apex Job - xxxxxxxxxxxxxxxxxxx."

 

Here's the log under Setup > Monitoring > Apex Jobs. I double-checked, and all jobs are at a Completed status:

(There are about 20 such messages as the one below, all with status "Completed", and all the Apex Job Ids are listed as why the class cannot be deleted, in the error above)

Action
 Submitted Date
Job Type
Status
Status Detail
Total Batches
Batches Processed
Failures
Submitted By
Completion Date
Apex Class
Apex Method
 <nothing listed here>
 4/10/2011 11:00 PM Batch Apex
Completed
 First error: Attempt to de-reference a null object 0 0 1 xxx 4/10/2011 11:00 PM CalcSummaryBatch  <nothing listed here>
...