[SalesForce] Standard Action override in Salesforce Lightning Experience

I have 2 Visualforce pages and I want to override the New, View and Edit actions of one of my custom Object. The New and Edit works perfect, but the view button still opens the salesforce standard page even it shows visualforce page overridden in object setup. What should I do in this case. I can place a button on record home page which takes me to my custom page but I want to override the view action of my custom object in lightning experience. It works in salesforce classic very well.

Your suggestions would be well appreciated.

Here is the code of my VF Page

<apex:page standardController="Timesheet__c" extensions="kandidaatController" docType="html-5.0" standardStylesheets="false" sidebar="false">
  <apex:includeLightning />

  <div id="lightning"></div>
    <script>
         var kandidateId = '{!checkBoxVal}' ;
         var kanId = '{!kanIdVal}' ;
         var Id= '{!Timesheet__c.Id}';
          if(kandidateId == 'true'){
               $Lightning.use("c:TimeSheetApp", function() {
                $Lightning.createComponent("c:TimeSheetViewCmp",
                {"timesheetId":Id,"kandidatId":kanId },
                "lightning",
                function(cmp){
                // do some stuff
                });
            });
         }
         if(kandidateId == 'false'){
               $Lightning.use("c:TimeSheetApp", function() {
                $Lightning.createComponent("c:TimeSheetEditCmp",
                {"timesheetIdSec":Id,"kandidatIdSec":kanId },
                "lightning",
                function(cmp){
                // do some stuff
                });
            });
         }
    </script>


</apex:page>

Best Answer

Hi Ajay Sharma,

     View mode overriding with visualforce is not supported in Lightning experience.

Reference: https://trailhead.salesforce.com/en/lex_dev_visualforce/lex_dev_visualforce_known_issues

enter image description here

I hope this answers your question.

Related Topic