Sunday 21 May 2017

Finding RecordType access to different profiles by using Metadata API




Consider a scenario in which you have an object which is having more than 10 recordtypes. Now you need to find out which all profiles have access to which recordtype. In order to achieve this, admin has to go to each profile and check the recordtype access. Imagine if you have more than 10 profiles which have access to different recordtype of this object.

In order to avoid this manual effort, I have created a VF page where user can select object and particular profile or all profiles and can see the result on a report. I am using metadata API to achieve this.

Please find below unmanaged pakage installation URL:

https://login.salesforce.com/packaging/installPackage.apexp?p0=04t90000000NPA0

Or you can download the code from Git by using below URL:

After installation, open tab "RecordType Access Finder". You may get "Unauthorized endpoint URL".



Add endpoint URL to remote site setting.

After opening the tab, select the object and profile for which you want to get report for recordtype access to different profiles. You can also specify "All" for profiles.





If you are getting some error by selection all profiles and clicking on "Retrieve and generate report" button, then it means you profile metadata file size is more so in this case, select one profile at one time and click on "Retrieve and generate report" button.
After this operation is finished, then select another profile and again click on "Retrieve and generate report" button. Repeat same process for all profiles you want to check.

Now click on report link and you will be redirected to SFDC standard report where you can see different recordtypes assigned to different profiles.


No comments:

Post a Comment