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? ns
- Query the Profile where the ID equals userInfo.getProfileID() and then use the profile.Opportunity.getDefaultRecordType() | |method. ] |
- Use Opportunity. SObjectType.getDescribe().getRecordTypelnfos() to get a list of record types, and iterate through them until [ J
isDefaultRecordTypeMapping() is true. Pencil & Paper | - Use the Schema.userlnfo.Opportunity.getDefaultRecordType() method. < Create the opportunity and check the opportunity.recordType before inserting, which will have the record ID of the current Dal user's default record type.
Reveal Solution Next Question