function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abhilash Gupta 10Abhilash Gupta 10 

How to get PageLayouts in controller based on user profile?

Hi All,

How to get PageLayouts and Recordtypes Settings  in controller based on user profile?
In a VF page,on selecting Profiles i want to display the page layouts and record types settings of that profile.

Regards
Abhilash
Yaswanth KothapalliYaswanth Kothapalli
Hi Abhilash,

You can use <apex:detail> Vf tag to implement the same. 
This tag uses the default page layout for the profile of the user viewing the page

Please refer following link for the same:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_detail.htm


Also you can check this links for reference:
>> http://www.mindfiresolutions.com/Record-Types-In-Apex-According-To-The-Current-Users-Profile-Availability-2463.php

>> http://salesforce.stackexchange.com/questions/11252/how-do-i-get-a-given-profiles-default-recordtype-for-opportunity

Thanks,
Yaswanth Kothapalli