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
...
...
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 1 year, 12 months agoNourelhouda101
Most Recent 1 month agoDhakedDev
4 months, 3 weeks agomnpatel
9 months, 1 week agochucksback
1 year agoskhan6525
1 year, 2 months agoJankovra
1 year, 12 months agoexampletopicscom
2 years, 5 months agolmeloni91
2 years, 5 months agoReyna
2 years, 6 months agolmeloni91
2 years, 5 months ago