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?
A.
Use Test.getStandardPricebookId() to get the standard price book ID.
B.
Use @IsTest(SeeAllData=true) and delete the existing standard price book.
C.
Use Test.loadData() and a Static Resource to load a standard price book.
D.
Use @TestVisible to allow the test method to see the standard price book.
It is A because Test.getStandardPriceBookid() has to be used for this purpose only.
Event id it is possible to use @isTest(SeeAllData=true) to access real data from a test Class, it is possible to read the Standard Price Book or to delete it anyway.
B is not correct, it specifically states "and DELETE the existing standard price book", which is not part of the question.
On the other hand, A is correct
B is not correct, it specifically states "and DELETE the existing standard price book", which is not part of the question.
On the other hand, A is correct
upvoted 2 times
...
...
This section is not available anymore. Please use the main Exam Page.CRT-450 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Jankovra
Highly Voted 2 years, 5 months agoNourelhouda101
Most Recent 7 months agoDhakedDev
10 months, 3 weeks agomnpatel
1 year, 2 months agochucksback
1 year, 6 months agoskhan6525
1 year, 8 months agoJankovra
2 years, 5 months agoexampletopicscom
2 years, 11 months agolmeloni91
2 years, 11 months agoReyna
3 years agolmeloni91
2 years, 11 months ago