2

I'm trying to replace the view of a standard page with my custom VF page. This works great on the classic theme but not on the lightning theme and mobile application.

  • In the VFP I checked "Available for Lightning Experience, Lightning Communities, and the mobile app".

enter image description here

  • In the view override, I checked "Use the Salesforce Classic override".

enter image description here

Visualforce page (I don't think it has something to do with the page itself, it doesn't work with any page):

<apex:page standardController="Opportunity" lightningStylesheets="true">
    <apex:detail subject="{!Opportunity.Id}" relatedList="true" title="true" rendered="{!Opportunity.Amount < 10}" />
    <apex:pageBlock rendered="{!Opportunity.Amount > 10}">
        <apex:pageBlockSection columns="1">
            <apex:pageMessage summary="Amount is less than 10" severity="warning" strength="3" />
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

I think that the problem is that for some reason the override doesn't even get fired on lightning experience. In the classic, I can see the URL changing to an APEX page, but on the lightning, it doesn't even bother trying to change the URL

  • URL in classic view (successful redirection):

https://c.eu16.visual.force.com/apex/xxx

  • URL in lightning (doesn't redirect):

https://eu16.lightning.force.com/lightning/r/Opportunity/0061t000001uPaDAAU/view

EDIT:

Although I really don't like this option, I tried creating a lightning component using the following code:

<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <aura:attribute name="greeting" type="String" default="Hello" access="global" />
    <aura:attribute name="subject" type="String" default="World" access="global" />

    <div style="box">
      <span class="greeting">{!v.greeting}</span>, {!v.subject}!
    </div>
</aura:component>

and changed the view override to the created component. I couldn't get it working that way too.

Your Answer

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

Browse other questions tagged or ask your own question.