I am trying to find out the available record types for each object for an entire profile.
Is this possible to do?
I would like to compare who has access to record types.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Yes, and there are a few ways of doing this.
When examining the XML there will be a section for record types, similar to the following:
<recordTypeVisibilities> <default>true</default> <recordTypes>MyObject.NewDefaultType</recordTypes> <visible>true</visibles> </recordTypeVisibilites>
Just look at the part for
This information would be available via the Metadata API. So You could pull down the Profile Metadata XML files via the Force.com IDE and when you've got the Profile Xmls, you can interrogate these files to find the recordTypeVisibilities elements
recordTypeVisibilities Indicates the visibility of record types for users assigned to this profile.
As an aside, users would be able to see records with all record types so long as they have Read Access to the Record. The explicit RecordType permissions only determine which RecordTypes the user can create records of, if they have Create Access on the Object.
Check out the answer to the Compare Profiles question on the stackexchange: https://salesforce.stackexchange.com/a/3693/220
The easiest way I know to do this is to use the force.com eclipse IDE where you can easily declare that you want all custom objects and profiles which will return the junction or intersection of profile settings including record types.
To help eliminate any eclipse specific behaviors, I typically create a package.xml file with the following text/elements:
<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>CustomObject</name> </types> <types> <members>*</members> <name>Profile</name> </types> <version>26.0</version> </Package>
Then I retrieve it using the workbench tool: http://workbench.developerforce.com by going to the migrate >> retrieve menu setting (I select single package when retrieving to be safe).
The resulting zip file will contain all of your profile settings including record type settings.
Hope this helps.