i have to pass the test class but the error is not resolving iam not bale to find the error can you please help what i have to do to pass this test class

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Values for previous months can not be modified.: []

Thanks, prince

  • 1
    Please provide code for better understanding. You must be violating a field validation. You can go through this post, It can help. salesforce.stackexchange.com/questions/25074/…
    – Animesh
    Feb 27, 2015 at 9:44
  • Can you share some of the code you are testing? It seems like you have a validation rule set up that triggers. Feb 27, 2015 at 9:44

1 Answer 1


From here:

Description Why am I getting a FIELD_CUSTOM_VALIDATION_EXCEPTION when trying to deploy a changeset?

Resolution 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.

In this case the validation rule, as the error suggests, is stopping the value of previous months from being modified.

Not the answer you're looking for? Browse other questions tagged .