0

I am deleting OpportunityShare records with following code in my developer console

List<OpportunityShare> osList = [Select opportunityid from OpportunityShare  where UserOrGroupId = '00GG000000XXXXXXXX' And Rowcause = 'Manual'];
delete(osList);

The above list has 7400 records and on execution I am getting Internal Salesforce.com Error.This is error is shown debug log of developer console.

Any Help is appreciated.

3
  • What is the internal Salesforce.com error? Please edit the question and add the error you are getting and where you see it (e.g., debug log in dev console, alert box from dev console, etc.). Commented Jul 19, 2013 at 11:05
  • It just says Internal Salesforce.com error in dev console debug log
    – codebandit
    Commented Jul 19, 2013 at 12:12
  • can you try with lesser number of records?? 1000 at a time
    – Sam
    Commented Jul 19, 2013 at 12:49

1 Answer 1

2

Whenever you get an internal salesforce error, something very bad happened in the underlying code. You're options are 1) Send the error id to Salesforce and request the underlying cause (which can often make troubleshooting it very straightforward), or 2) Try anything and everything to work around it.

In your case I'd recommend trying to delete just one opportunity share first and see if that works. If it doesn't try manually deleting the opportunity share via the sharing page and see if you get a nicer error there. If it does, you might trying using a binary search technique to see if there is one particular record that is causing the error and just skip that one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .