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

Testing method do not see my Pricebook records while it is working on manual test
Hello,
In my test method it looks like there is no pricebook record I can use.
The following code returns the value 0 while I have 4 Pricebook records in my sandbox.
System.debug('There is '+[SELECT COUNT() FROM Pricebook2]+ ' Pricebook(s)');
Do I have to recreate all records in the test method in order to use them?
You will need to use:
@isTest(SEEALLDATA = true)
All Answers
You will need to use:
@isTest(SEEALLDATA = true)
Thank you