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

System.DmlException (FIELD_CUSTOM_VALIDATION_EXCEPTION)
Hi,
I'm writing a test class to check that I can change the status field of one of my objects successfully.
When I anonymously create the record with status ='New' and then change the status='Scheduled', I'm not facing any issues.
But when I'm using the exact same code in a Test Class, I'm facing the following issue:
EXCEPTION_THROWN [34]|System.DmlException: Update failed. First exception on row 0 with id 08p76000000sxxxxx; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Cannot change status from New to Scheduled: [Status]
Any advice is really appreciated. Thanks
Can you try using IsTest(SeeAllData=False) Annotation and check again .
Thank you.
All Answers
I dont have any Validation Rule or Before Trigger logic on this.
Can you try using IsTest(SeeAllData=False) Annotation and check again .
Thank you.
Hi @Subrat. Thanks for your help.
However, It's not helping :(
Can you share your class and test class both .
Thank you.
Hi Subrat,
The actual annotation is @isTest(SeeAllData=true)
Thanks so much. I chose your answer as best.