nerdexam
Salesforce

PDI · Question #137

A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineItem trigger. Which method allows access to the price book?

Sign in or unlock PDI to reveal the answer and full explanation for question #137. The question stem and answer options stay visible for context.

Submitted by anna_se· Apr 18, 2026Testing, Debugging, and Deployment

Question

A developer wants to get access to the standard price book in the org while writing a test class that covers an OpportunityLineItem trigger. Which method allows access to the price book?

Options

  • AUse Test.loadData ( )and a static resource to load a standard price book
  • BUse @TestVisible to allow the test method to see the standard price book.
  • CUse Test.getStandardPricebookid ( ) to get the standard price book ID.
  • DUse @IsTest (SeeAllData=True) and delete the existing standard price book

Unlock PDI to see the answer

You've previewed enough free PDI questions. Unlock PDI for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#Apex Testing#Test Data Setup#Standard Price Book#System.Test Class
Full PDI Practice