You need to sign in to do that
Don't have an account?
Trying to Delete a Apex Class
Need help, I'm in the Force.com IDE. I have deleted the calss in the sandbox, but will not delete in production.
Class Names: CloneListTest
Error 1: test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required. Tremor Video Production line 1 Force.com code coverage warning
Error 2: System.NullPointerException: Attempt to de-reference a null object CloneListTest.cls /Tremor Video Production/src/classes line 56 Force.com run test failure
Class Names: CloneListTest
Error 1: test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required. Tremor Video Production line 1 Force.com code coverage warning
Error 2: System.NullPointerException: Attempt to de-reference a null object CloneListTest.cls /Tremor Video Production/src/classes line 56 Force.com run test failure
Do one thing modify the test class with like only blank method like below .
And deploy the code to controller and then delete ,
Do you want to delete only the test class or CLoneListController as well .
All Answers
Hi Prentiss
Check this below article.Hope it helps you.
https://help.salesforce.com/apex/HTViewSolution?id=000006188
How to Disable or Delete an Apex Class or Trigger from a Production Org
Knowledge Article Number: 000006188
Description- An Apex class or trigger must be removed from a production instance if it is blocking a deployment or is no longer needed.
- Apex code may not be modified directly within a Production org, so it requires a couple of steps using Developer tools.
- This article gives instructions using the Force.com IDE
- This is the only way an Administrator or Developer can disable or remove Apex in a Production org.
Resolution- Force.com IDE should be installed and working.
- Connect to the Sandbox Instance using the IDE and find the class or trigger that you want to delete.
- Open the matching .xml file change the Status XML tag from "Active" to "Deleted" if you want to remove the trigger or class, or to "Inactive" if you want to disable the trigger.
- Apex class Status can only be changed to "Active" or "Deleted", not "Inactive".
- Save the file.
- Select the two files (Code and XML) using Ctrl-click, then right click on one of them. Select Force.com > Deploy to server.
- Provide your credentials for the production org and follow the steps.
Regards
Mohit Bansal
In case, you face any issue, drop me message on forum or Skype me @mohit_bansal17, if you need any help.
Please mark this as solution by selecting it as best answer if this solves your problem, So that if anyone has this issue this post can help
Error 1: test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required. Tremor Video Production line 1 Force.com code coverage warning
Error 2: System.NullPointerException: Attempt to de-reference a null object CloneListTest.cls /Tremor Video Production/src/classes line 56 Force.com run test failure
If you want to delete Apex class from production .You need to pull the apex classes to eclipse . Select the metadata XML fiel related to the class .
You will get the file like below .
After this save the class it will automatically delete the class from production .
Thanks
Manoj
You only need to pull the apex classes from production and needs to save .
Hi Prentiss
Just copy and paste code in Sandbox and then in IDE change status to Deleted from Active.
It will delete the class from production.
Regards
Mohit Bansal
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>20.0</apiVersion>
<status>Deleted</status>
</ApexClass>
Error 1: test coverage across all Apex Classes and Triggers is 72%, at least 75% test coverage is required. Tremor Video Production line 1 Force.com code coverage warning
Error 2: System.NullPointerException: Attempt to de-reference a null object CloneListTest.cls /Tremor Video Production/src/classes line 56 Force.com run test failure
Hi Prentiss ,
Try to create a object with production credential and pull from production follow the same step in production and let me know if you will get error .
I have deleted 27 classes from one organisation today .
This is Line 56 which is my issue
What exctly your issue i s,You need to delete the class or you need any solution for your class or Trigger ?
Have you created a project in Eclipse with production credential ?
Have you modified the className.cls-meta.xml ?
After modifyed the xml file ,Have you saved the class.
Still you are facing issue ,please send your code to my email ,
manojjena20@gmail.com
Do one thing modify the test class with like only blank method like below .
And deploy the code to controller and then delete ,
Do you want to delete only the test class or CLoneListController as well .
Thanks....Let you know.