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 253 discussion

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

A developer is creating a page that allows users to create multiple Opportunities. The developer is asked to verify the current user’s default Opportunity record type, and set certain default values based on the record type before inserting the record.

How can the developer find the current user’s default record type?

  • A. Use the Schema.userInfo.Opportunity.getDefaultRecordType() method.
  • B. Query the Profile where the ID equals userInfo.getProfileID() and then use the profile.Opportunity.getDefaultRecordType() method.
  • C. Create the opportunity and check the opportunity.recordType, which will have the record ID of the current user’s default record type, before inserting.
  • D. Use Opportunity.SObjectType.getDescribe().getRecordTypeInfos() to get a list of record types, and iterate through them until isDefaultRecordTypeMapping() is true.
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
aregas
5 months, 2 weeks ago
Selected Answer: D
D) RecordTypeInfo Class Contains methods for accessing record type information for an sObject with associated record types. - isDefaultRecordTypeMapping() Returns true if this is the default record type for the user, false otherwise. https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_RecordTypeInfo.htm#apex_Schema_RecordTypeInfo_isDefaultRecordTypeMapping
upvoted 1 times
...
irina_735
1 year, 2 months ago
Selected Answer: D
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_RecordTypeInfo.htm#apex_Schema_RecordTypeInfo_isDefaultRecordTypeMapping
upvoted 3 times
...
DonAldos
1 year, 7 months ago
Selected Answer: A
To find the current user’s default record type, you can use the getDefaultRecordType() method from the Schema.UserInfo class, which returns the default record type ID for the specified object and user. In this case, you would use Schema.UserInfo.Opportunity.getDefaultRecordType() to get the default record type ID for Opportunities.
upvoted 2 times
vancika
1 year, 7 months ago
There's no such class as Schema.UserInfo. Correct Answer is D
upvoted 2 times
...
irina_735
1 year, 2 months ago
UserInfo class is in System namespace. There is no Schema.UserInfo class.
upvoted 1 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 ...