Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 6 discussion

Actual exam question from Salesforce's CRT-450
Question #: 6
Topic #: 1
[All CRT-450 Questions]

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.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Jankovra
Highly Voted 1 year, 12 months ago
Selected Answer: A
the Right answer
upvoted 6 times
...
Nourelhouda101
Most Recent 1 month ago
Selected Answer: A
A is correct
upvoted 1 times
...
DhakedDev
4 months, 3 weeks ago
Selected Answer: A
A is correct
upvoted 1 times
...
mnpatel
9 months, 1 week ago
It is A because Test.getStandardPriceBookid() has to be used for this purpose only.
upvoted 2 times
...
chucksback
1 year ago
A because the test class has a method with the same name.
upvoted 1 times
...
skhan6525
1 year, 2 months ago
Selected Answer: A
C THE RIGHT ONE
upvoted 1 times
...
Jankovra
1 year, 12 months ago
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.
upvoted 1 times
...
exampletopicscom
2 years, 5 months ago
Selected Answer: B
use the @isTest(SeeAllData=true) annotation to grant test classes and individual test methods access to all data in the organization
upvoted 1 times
lmeloni91
2 years, 5 months ago
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 5 times
...
...
Reyna
2 years, 6 months ago
why not B ?
upvoted 1 times
lmeloni91
2 years, 5 months ago
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
...
...
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.

SaveCancel
Loading ...