+ Start a Discussion
Snita LalSnita Lal 

New record redirect with visualforce page showing classic on Salesforce1 even with new lightning tab style


We are using the below extension class and visualforce page on Account to use in a custom action to create a record. When using the Salesforce1 app the visualforce page shows in a classic view and not in lighning whilst we are using the new lightningStylesheets="true" and we've ticked the checkbox to make the page available in mobile and lightning.

We've ended up down this route as we wanted the user to be redirected to the record created and not the parent on Salesforce1 because the user is expected to do more functionality on the record once created. Ideally we want to achieve this in the simplest way as we feel the process is over engineered.

Any help would be greatly apprieciated.


public with sharing class OppExtension {

Account acc;

public Operational_Opportunities__c opp{get;set;}

public OppExtension(ApexPages.StandardController controller) {
    this.acc= (Account)controller.getRecord();
    opp = new Operational_Opportunities__c();

public PageReference save() {
    opp.account__c= acc.Id;
    insert opp;
    PageReference pg = new PageReference('/'+Opp.id);
        return pg;  

<apex:page standardController="Account" extensions="OppExtension" lightningStylesheets="true" >
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection > 

  <apex:outputField value="{!Account.Name}"/>
  <apex:inputField value="{!opp.Name}"/>
  <apex:inputField value="{!opp.Type__c}"/>
  <apex:inputField value="{!opp.Stage__c}"/>
  <apex:inputField value="{!opp.Quote_Submission_Date__c}"/>
  <apex:inputField value="{!opp.Close_Date__c}"/>
  <apex:inputField value="{!opp.Service_Start_Date__c}"/>

<apex:commandButton value="Save" Action="{!Save}"/>

Vinod ChoudharyVinod Choudhary
Hi Sunita,

you have override visual force component instead of standard one. Open view and click on a override VF component.
Steps-> Setup-> Object Manager -> Opportunity Find override vf page in Action and Custom Links There is a checkbox and make sure it's unchecked.

Snita LalSnita Lal
Hi Vinod,

We haven't done a standard override on opportunity this is a custom object Operational Opportunity where we leverage Force.com to collect transactional orders. Our custom action is on the parent object Account, where we have created a new action, not an override, to use the visualforce page because the standard create record action, took you back to the parent rather than the newly created child record. We have a redirect in the visualforce page and excited to see the lightning style sheet option but this shows in a classic view on Salesforce1 which I didn't think was possible.

This is what it looks like in lightning

User-added image

But then looks like this on Salesforce1

User-added image