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
MANISHA AKHADEMANISHA AKHADE 

hello everyone i am having question,in sandbox i am having 80% code coverage for apex class while in production it is having 65% code coverage can anybody please help.Thank You in Advance!

Sai PraveenSai Praveen (Salesforce Developers) 
Hi Manisha,

Can you check if @seealldata=true is set on the test class.

Thanks,
 
MANISHA AKHADEMANISHA AKHADE
where i need to check this condition if @seealldata=true in sandbox or production
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Manisha,

You need to check that in both. Because if the above line is present then the test class will take the data from the sandbox and run based on it.  So the code coverage will depend on the data present in it. Please find the below article for same.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_seealldata_using.htm

If this solution helps, Please mark it as best answer

Thanks,
 
MANISHA AKHADEMANISHA AKHADE
Thank you for your valuable guidance.