Created
December 12, 2014 01:11
-
-
Save emoran/8150bc3c8ef620dc9eb0 to your computer and use it in GitHub Desktop.
Get the default user profile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//find all Opportunity record types | |
List<Schema.RecordTypeInfo> infos = Schema.SObjectType.Event.RecordTypeInfos; | |
Id defaultRecordTypeId; | |
//check each one | |
for (Schema.RecordTypeInfo info : infos) { | |
if (info.DefaultRecordTypeMapping) { | |
defaultRecordTypeId = info.RecordTypeId; | |
} | |
} | |
recordTypeId = defaultRecordTypeId; | |
//here is the default Opportunity RecordType Id for the current user | |
System.debug(defaultRecordTypeId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment