0

Let's assume that I have 2 different page layouts for Tasks. One presents the usual standard fields, additional fields, etc., and the other one presents a custom VisualForce page we've built that displays other additional information.

I know that I can assign different page layouts depending on profiles and record types. However, what I want is the user to be able what information he sees: he can choose to see the fields or the VF page.

I could create a single page with all the info, but then it would become cluttered and I think the UX would be worse.

Is there a way to have the user choose what layout to see? I'm happy if this means having to click a different tab at the top.

0

By the standard way, as you already know, we can only configure which standard page layout a user can see on the profile basis.

If we completely override the view action of an object with a visualforce page, then that will be applied for all the users, every user will see the visualforce page while viewing a record, and you will have to make modifications in your page code to handle profile level differences.

If you are OK to click an extra button, then my suggestion would be to create a custom detail page button, and put in on standard page layouts. When user will click on a record, they will see standard layout assigned to them by profile. If they want to see more details, they can click on the custom button over there, and that will open your visualforce page for them.

Hope this helps!

0

Classic

Consider creating a Visualforce button that links to the page, and add that to your layout. The user can go to the page by clicking the button. You'll need to provide a way to get back to the record on your Visualforce page. This is pretty much the de facto way of doing this in Classic.

Or, consider putting the page inside its own Layout Section (with Header). This will allow the user to collapse the page when they don't want to view it, and expand it when they do.

Lightning

You can use Lightning Experience (LEX) if you want tabs, or even a side-by-side layout of your page layout and Visualforce page. Create a new Record Page for Tasks, add the Visualforce page as a component, and Activate it for the profiles you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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