PrepAway - Latest Free Exam Questions & Answers

While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a stand

While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard PriceBook since one already exists in the org.

How should the Developer overcome this problem?

A. Use Test.getStandardPricebookId() to get the standard PriceBook ID.

B. Use @IsTest(SeeAllData=true) and delete the existing standard PriceBook.
C. Use Test.loadData() and a Static Resource to load a standard Pricebook.
D. Use @TestVisible to allow the test method to see the standard PriceBook.


Leave a Reply