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

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 270 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 270
Topic #: 1
[All Certified Platform Developer II Questions]

A company wants to run different logic based on an Opportunity’s record type.

Which code segment handles this request and follows best practices?

  • A.
  • B.
  • C.
  • D.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
dasabhisek404
4 months ago
Selected Answer: C
Option D is given wrong. It was- Id recType_New = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('New').getRecordType.Id(); Id recType_Renewal = Schema.SObjectType.Opportunity.getRecordTypeInfosByDeveloperName().get('Renewal').getRecordType.Id(); In that case C is right
upvoted 1 times
...
parth9927
5 months, 3 weeks ago
Selected Answer: C
C is also the correct answer because it can handle code dynamically. don't need to hard code record type name.
upvoted 1 times
...
stan_malta
12 months ago
Selected Answer: D
Save SOQL where you can.
upvoted 1 times
...
Udayudyvk1818
1 year, 3 months ago
Selected Answer: D
answer should be D. to simply use getRecordTypeInfosByDeveloperName https://salesforce.stackexchange.com/questions/11968/what-would-be-the-best-approach-to-get-the-recordtype-id
upvoted 4 times
...
Ullr
1 year, 7 months ago
D only Don't SOQL to RecordType
upvoted 3 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 ...