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

Problem with test class.
I am trying to run a test class and I got this error message. What does it mean?
The problem here is there is no such field with the API name as Standard Price or there is no validation rule with message as STANDARD_PRICE_NOT_DEFINED.
System.DmlException: Insert failed. First exception on row 0; first error: STANDARD_PRICE_NOT_DEFINED, No standard price defined for this product: []
If you create a product2 record, you must create a pricebookentry record where pricebook2id is the ID of the standard price book with some value. You must use @isTest(SeeAllData=true) to query this ID value.
All Answers
If you create a product2 record, you must create a pricebookentry record where pricebook2id is the ID of the standard price book with some value. You must use @isTest(SeeAllData=true) to query this ID value.
Yes. Exactly. This is the error. Can you please elaborate. I have done...
@isTest(seeAllData=true) but still same.
Is there a way to write a test class without the seealldata=true declaration?