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
kabkab 

Getting error on Code deployment to prod

Hi,

I am having trouble in code deployment to prod.

When I deploy to prod 4 classes are giving exception that id not found.

When I fix the error and try to deploy the code then get the error that  code coverage is less than 75%.

 

I tried to deploy a different class which has less coverage and getting exception of those other previous classes.

 

Then I tried to deploy the class with more coverage and those classes I fixed error together and getting the same error less than 75%.

 

I am not sure what to do now.

I tried individual classes and getting exception and tried together all classes and getting less coverage although I increased the coverage and everything is failing.

 

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Bhawani SharmaBhawani Sharma

May be in your test classes you are using hardcoded ids of sandbox ands these ids are not available on production.

 

Can you please check your test classes one more time?

All Answers

kiranmutturukiranmutturu

Are you giving any static ids in the test classes....?

Bhawani SharmaBhawani Sharma

May be in your test classes you are using hardcoded ids of sandbox ands these ids are not available on production.

 

Can you please check your test classes one more time?

This was selected as the best answer
kabkab

Yes , there were some problem in the test code coverage due to the ids were deleted.and fixed  thanks all. :smileyhappy: