You need to sign in to do that
Don't have an account?

Stuck on deployment - Code Coverage Failure Issue
Hello,
Need your suggestion if anybody faced smilar issue before.
Since the last couple of days facing an issue while validating changeset on production. I tried almost all ways from my end but not able to tackle the issue yet. Please share your suggestions, if any.
I have an apex class which is 96% cover without any failure on sandbox.
When I am trying to validate the same with its test class on the production I am getting an error like below:

I am passing the Case Id to the method and used it to filter in the SOQL of its custom child object called "Service Report". This query results in empty using the 'Case Id' on Production only. I am not facing this issue in the sandbox.
Production's overall coverage is 85%.
Debug from the production:

Hopes to hear back from you!
Welcome to your suggestions!
Thanks,
Nilesh
Need your suggestion if anybody faced smilar issue before.
Since the last couple of days facing an issue while validating changeset on production. I tried almost all ways from my end but not able to tackle the issue yet. Please share your suggestions, if any.
I have an apex class which is 96% cover without any failure on sandbox.
When I am trying to validate the same with its test class on the production I am getting an error like below:
I am passing the Case Id to the method and used it to filter in the SOQL of its custom child object called "Service Report". This query results in empty using the 'Case Id' on Production only. I am not facing this issue in the sandbox.
Production's overall coverage is 85%.
Debug from the production:
Hopes to hear back from you!
Welcome to your suggestions!
Thanks,
Nilesh
Greetings to you!
Please refer to the below links which might help you further with the above issue.
https://developer.salesforce.com/forums/?id=906F0000000AdjwIAC
https://developer.salesforce.com/forums/?id=906F0000000kIlRIAU
https://developer.salesforce.com/forums/?id=906F0000000AeAeIAK
https://help.salesforce.com/articleView?id=000187272&language=en_US&type=1
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Maybe you are using the hard code Id of any object record. If yes then you have to create a record inside the test class after that use that Id in your query.
Here is My test class:
Thanks,
Nilesh