1

I have two layouts for a custom object i.e. "Company__c". Now I wan to use a layout according to the selection of a pick-list value in user profile i.e. System Administrator. Lets say I have two layouts named as Layout_1 and Layout_2, such both layouts have different fields and sections.

And there is a pick-list field in system administrator profile having two values named as Value1 and Value2. On selection of Value1, The object Company__c should use/show Layout_1 and on selection of Value2, it should use/show Layout_2.

How can I do this? Please help me.

1
  • Have you tried using Record Types?
    – Saroj Bera
    Dec 15, 2015 at 13:11

2 Answers 2

0

The detail page layout depends on the profile the user is assigned to. It can not be linked to the field value.

What you can do is to override a standard page layout with a visualforce page. You will get a full control on the look & feel of the page and additionally you can control visibility of the fields shown to certain users based on their data (eg. profile, profile field value etc.)

2
  • But for overriding a standard page with a visualforce page, I have to override all standard pages with their relative visulaforce pages. Am I right??? Dec 15, 2015 at 11:41
  • @KhawajaM.Awais You can have only one overridden page layout for all profiles, and do layout validation inside the visualforce page based on the current user settings (profile/field/etc) Dec 15, 2015 at 12:36
0

I got the answer for my question. We can do it by using visualforce page layouts. i.e. the pages made by us in visualforce.

Here I queried the required field from system administrator profile, and on the basis of the value of the field, I made page-reference to the desired page. That's what I have done to solve this problem and I got my desired result. :) I believe it will help others too.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .