function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eric BakerEric Baker 

Trial to Full Account with 0% test coverage. Now I'm stuck?

Hi all-- My trial account was approved as a Salesforce Foundation account yesterday, and I am now unable to save or edit any Apex code or triggers. I understand that this is properly done in a sandbox, which I have created.

However, when I try to deploy an Inbound Change Set, I receive a fatal error because my current production code has 0% test coverage -- all done in my Trial account. (Obviously not the best development practice - I know - but was trying to quickly test and evaluate Salesforce for our needs.)

So I think I am now in a catch-22 situation where I can't edit my code to actually make it 75% test compliant and I can't import new tested Inbound sandbox code because my current code is not compliant.

Ideas for getting un-stuck?
sherry pengsherry peng
HI, Sidney, you might need to write some testing code and include the test classes to the change set then redeploy it to production.
Eric BakerEric Baker
Thanks, but unfortunately, I can't deploy any code into my production environment because my production environment has 0% coverage as it is now - converted from a Trial account.

When trying to deploy an Inbound Change Set, this is the error I get for my production environment:
Code Coverage Failure Your organization's code coverage is 0%. You need at least 75% coverage to complete this deployment. Also, the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage.
Ram Jampana 5Ram Jampana 5
Hi Sidney...
Deploy the Test Classes first into the Production and than the Triggers in a seperate change set..... The Deployment should not stop you from pushing the Test classes first..

Cheers....
sherry pengsherry peng
I did not face your situation before. Will you get error if delete all code in production use migration tool? If you can delete, then you can  redeploy these code with test classes? 
Eric BakerEric Baker
@Jane: I get this error when I try to delete a trigger in production from the Developer Console:
Cannot complete this operation. Cannot delete classes/triggers in production. Use compileAndTest verb to delete. : null

@Ram: So the suggestion is to fully develop my test classes for my current code in the sandbox, and then it should let me bring them in as an Inbound Change Set since they are only Test classes? I can give a try.

The Inbound Change Set that I tried to bring in before and it errored did not have any substantive code changes - I just added a comment to a trigger and it wouldn't even let me bring that in.
Ram Jampana 5Ram Jampana 5
Yes... By deploying the fully developed test classes first from your sandbox to the Production will increase your overall Organization code coverage followed by the Trigger deployment.

Just a quick question... did you try running all your test classes once in order for the system to re calculate ??

Go to the Apex Classes and select "Run All Tests" and see if that makes any difference.

Cheers....
sherry pengsherry peng
@sidney, you can't delete code use develop console. You can only delete triggers and classes use migration tool. Migration tool is another SalesForce deploy tool. Use ant undeploycode Command to delete the code. Of course, before running this command, you need modify several configuration files in that tool. For detail, you could refer to migration tool user guide.