Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I'd like to retrieve the record types available for an object. Is the recommended way to do this to use the recordTypeInfos collection returned on the object's metadata?

share|improve this question

1 Answer 1

Yes it is.

RecordTypeInfo Methods The following are methods for RecordTypeInfo. All are instance methods.

  • getName() Returns the name of this record type.

  • getRecordTypeId() Returns the ID of this record type.

  • isAvailable() Returns true if this record type is available to the current user, false otherwise. Use this method to display a list of available record types to the user when he or she is creating a new record.

  • isDefaultRecordTypeMapping() Returns true if this is the default record type mapping, false otherwise.

Note that as it says, "is available" means the user can create new records with this type. It doesn't affect whether the users can see existing records of the type.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.