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

Test classes failing
Hi
My test classes are failing and I donno what fix needsto be done .I dont understand code and because of which my production push is not happening.
Can anyone pleae help me
My test classes are failing and I donno what fix needsto be done .I dont understand code and because of which my production push is not happening.
Can anyone pleae help me
For posting on forums you should always post your code snippet for other users to view.
This is a common exception that stems from a validation exception. This error occurs when there is a validation rule and one of the test methods is hitting exception caused by a validation when creating/updating a test record.
The first step when solving a problem like this is to identify the field that is causing the exception. The field is named in the error message. Here it is LeadSource. In Salesforce, a less preferable way of tackling this problem is editing the validation rule to exclude the validation rule associated with LeadSource. The proper solution is to modify the record(s) in the DML operation such that they comply with the validation rule. The validation rule is there for a reason, so it should be obeyed. Turning off the validation rule temporarily isn't advisable, as it means the test method isn't reflective of the correct production schema, and hence neither is your Apex code.