You need to sign in to do that
Don't have an account?
Aviv Gabay
Creating a generic Visualforce page to load both classic pages and Lightning pages
I'm trying to override View action of a Standard Object (Opportunity in this case) with a Visualforce page. My override works on both Classic and Lightning theme. However, on lightning pages, my Visualforce page changes the original page's layout.
My Visualforce Page:
<apex:page standardController="Opportunity" lightningStylesheets="true">
<apex:detail subject="{!Opportunity.Id}" relatedList="true" title="true" rendered="true" />
</apex:page>
It works perfectly on the Classic theme, but here is how it looks on Lightning compared to the original Opportunity page without override:
How do I achieve the functionality of creating a generic Visualforce page to load both classic pages and lightning pages?
And if it's not possible, what are the alternatives to achieve it?
My Visualforce Page:
<apex:page standardController="Opportunity" lightningStylesheets="true">
<apex:detail subject="{!Opportunity.Id}" relatedList="true" title="true" rendered="true" />
</apex:page>
It works perfectly on the Classic theme, but here is how it looks on Lightning compared to the original Opportunity page without override:
How do I achieve the functionality of creating a generic Visualforce page to load both classic pages and lightning pages?
And if it's not possible, what are the alternatives to achieve it?
Sorry for this issue you are encountering.
May I suggest you please check below link from the stack exchange community with a similar discussion which might help you further.
- https://salesforce.stackexchange.com/questions/96220/how-to-build-custom-ui-that-works-both-for-users-that-have-opted-in-to-lightning
Please let us know if this helps.Kindly mark this as solved if the reply was helpful.
Thanks,
Nagendra
Please follow below url to achive your goal:-
https://trailhead.salesforce.com/en/modules/lex_dev_visualforce/units/lex_dev_visualforce_multipurpose_pages
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh