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
Kristen LundKristen Lund 

Field Change in Apex, lost code coverage

We have an Apex class that creates a pdf based upon certain fields, I modified these fields yesterday (which I've done successfully before), and deployed to full and production without any issues. However, when I take a look at the code coverage in production, it is 0%. How was this successfully able to deploy into production with 0% coverage, and how do I get my code coverage back?

I am not a developer, but know enough to edit (not create) Apex. I've modified this specific class before all the while keeping the code coverage, but I have no idea what happened here. Any help would be greatly appreciated!
 
Alap MistryAlap Mistry
Hello Kristen Lund,
Click Developer Console (to open developer console) under your name dropdown. In Developer Console, click Edit->Search in Files and search for your old field name, then you get some result. Then click on one result and click Open Selection. You will get highlighted text for your field and then click Edit->Find/Replace All. In Replace, write your old field name and press enter then in With, write your new field name and press enter. You will get new updated code.
If error is occur, then post here. If it is useful, then mark it as best answer (for close this thread).
Regards,
Alap Mistry
Kristen LundKristen Lund
Thank you for the response, Alap - I found last night that it was actually being caused by one of by processes and when this was deactivated, the class had proper coverage. Took awhile to figure it out, now I just need to fix the process/case so both can be on and still give the appropriate code coverage.