1

I want to access Standard PriceBookEntry ID in my Test Class.

I know by using @isTest(SeeAllData=true) we can create one. But, my requirement is not to use (SeeAllData=true).

I also thought to make a Standard PriceBookEntry ID entry in Custom Setting and access it in Test Class, but here also without (SeeAllData=true) we can't access Custom Setting.

So, any workaround/solution for this?

1 Answer 1

6

This was updated recently. You can leave SeeAllData=false and still access the standard pricebook now. See link

Test.getStandardPricebookId

You must log in to answer this question.

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