Skip to main content
Sara Monksfield (RSC) が「#Apex」で質問
I'm really struggling with Apex and the code coverage of our org.  I'm not a developer and I'm completely stuck.

We have 74% code coverage in our production org. We also have 4 Apex triggers and 15 Apex classes that are completely redundant and relate to a custom object that is never used.  We want to delete the complete object and all related code.  The Apex classes all fail so getting rid of them would bring our code coverage up to a decent level.

I can't seem to get rid of them. I can't deactivate the triggers in Sandbox and deploy them to production because code coverage is not high enough.  Plus some of our code also has 0% coverage. I've had Eclipse installed but when I try and make one of the unwanted triggers inactive I get errors:

System.QueryException:List has no rows for assignment to SObject

System:Exception:Assertion Failed

System:Exception:Assertion Failed

System:Exception:Assertion Failed

And two 'System.DmlException:Update failed' that trigger a validation rule on the Account in the production org

How do I unravel this so that I can get rid of this code?  Is there a simple way?  I can't deploy anything that requires code changes at the moment so I have to fix it somehow.

Can anyone help explain it in simple terms so that a dummy can understand it please?

Thank you.
5 件の回答
  1. 2016年11月7日 15:17
    You should first delete it from your sand box using force.com IDE.

     

    Below are the steps:

    1) From Force.com IDE, select the class that you want to delete (Look for .xml extension )

    2) Open that .xml version of your class and change the Status tag to Deleted.

    3) Right click and save the file.

    4) Now select "SRC" folder and right click--->Select  Force.com---> select Deploy to server

    5) Log into your production org and follow the steps.

     

    Note: if you have any test class for the class that you are deleting make sure you do the same like above and then select those 2 classes for final deployment.

     

    Hope it helps.
0/9000